[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Additional behaviors for a scrolling movie clip

Posted on 2008-01-29
4
Medium Priority
?
155 Views
Last Modified: 2010-04-03
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

0
Comment
Question by:gabrielPennyback
  • 2
3 Comments
 
LVL 39

Expert Comment

by:blue-genie
ID: 20832151
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.
0
 
LVL 1

Author Comment

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

Thanks,

John
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 1500 total points
ID: 20848306
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?
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
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,…
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…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

590 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