Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I stop my scrolling effect in Flash

Posted on 2010-08-23
3
Medium Priority
?
221 Views
Last Modified: 2013-11-11
Hey Guys

I have this setup where I want the movieClip to scroll up and down the page but it seems to flick back to the beginning.

It's kinda hard to explain but I have attached the swfs and code that run the scrolling effect for you to have a look at and get an idea of what is happening.

I just want the bio.swf file to stop at the top and bottom of itself and not "repeat" itself. I don't really know why it is.

Any help as to what I'm doing wrong?


Thanks

L
onClipEvent (load)
{
   ycenter=600
   ;
   speed=1/10;
}
onClipEvent (enterFrame)
{
   var distance=_root._ymouse-ycenter;
   _y+=(distance*speed);
   if (_y > 0) _y=-2000;
   if (_y < -2000) _y=0;
}

Open in new window

JanetMain.swf
Bio.swf
0
Comment
Question by:Leroice
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
chorejason earned 2000 total points
ID: 33507877
Try this:

onClipEvent (enterFrame)
{
   var distance=_root._ymouse-ycenter;

   if (_y < 0 && _y > -2000)
_y+=(distance*speed);

}
0
 
LVL 1

Expert Comment

by:chorejason
ID: 33551126
Hi, was my comment helpfull? Did it solve your problem?
0
 

Author Closing Comment

by:Leroice
ID: 33552139
Hey Jason

Sorry for the late reply - just saw this now.

I just tried it and it worked great! Thanks heaps. The only problem is that when it stops it doesn't head back the other way. I need it to continue to scroll back and forth. Do I need to ask another question or can this code be edited to achieve that.


Thanks again

Leigh
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question