We help IT Professionals succeed at work.

Additional behaviors for a scrolling movie clip

John Carney
John Carney asked
on
This is a followup to a previous question:
http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/Q_23024293.html

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?
And/or:
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.

Thanks!

John


var xcenter = 150;
var speed = 1/10;
Start();
 
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.Stop();
};
this.onRollOut = function () {
        this.Start();
};

Open in new window

Comment
Watch Question

Top Expert 2009

Commented:
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.
blu.
John CarneyReliability Business Tools Analyst II

Author

Commented:
HI blue-genie.  You can download the file here: http://www.discretedata.com/Ex-Ex/filmStrip1.fla
I'm using Flash CS3.

Thanks,

John
Top Expert 2009
Commented:
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?

Explore More ContentExplore courses, solutions, and other research materials related to this topic.