Additional behaviors for a scrolling movie clip

This is a followup to a previous question:

How do I modify that code so that:
1) the movie starts playing at its default speed as defined in line 2, regardless of where the mouse is at the time the page loads?
2) the movie scrolls only when the mouse is directly over it (range: y=150 to y=240). For this to be relevant, I would just change the code so that the MC stops on Release, on rollOver.

#1 is the more important of the two.



var xcenter = 150;
var speed = 1/10;
function Start() {
        this.onEnterFrame = function() {
                var distance = _root._xmouse - this.xcenter;
                this._x += (distance*this.speed);
                if (this._x>0) {
                        this._x = -300;
                if (this._x<-300) {
                        this._x = 0;
function Stop() {
        this.onEnterFrame = null;
this.onRollOver = function() {
this.onRollOut = function () {

Open in new window

John CarneyReliability Business Tools Analyst IIAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

could you pls upload your file so we can see your code in some sort of context.
also which version of flash are you using.
John CarneyReliability Business Tools Analyst IIAuthor Commented:
HI blue-genie.  You can download the file here:
I'm using Flash CS3.


Hey John, question, i've just downloaded the file and run it Ctrl Enter..
and in response to your point 1.
1) the movie starts playing at its default speed as defined in line 2, regardless of where the mouse is at the time the page loads?

it starts scrolling immediately to the right, irrespective of where my mouse is (in this case on my second monitor) - so what exactly is wrong?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.