deominate
asked on
help playing frames based on _xmouse
Just started learning flash and actionscript two weeks ago.
sorry if this question is too easy.
I'm trying to play frames when the mouse moves left or right.
when the mouse moves right I play the next frame,
subsequently when the mouse moves left I play the previous frame.
Only problem is... I only want to play frames when the mouse is moved inside the movie.
I tried to use an if that specifies the x bounds of the movie...
but don't know what I'm doing...
Can you help with this code?
or suggest an easier way of accomplishing this?
CODE BELOW--
stop();
//WORKS only over entire page
//need it to only work between x values
var point = 0;
var newpoint = 0;
// x values of the movie
if (_xmouse <= 435 && _xmouse >= 114){
point = _xmouse;
_root.onMouseMove = function (){
newpoint = _xmouse;
// set max frames
if(point > newpoint && _root.nextFrame() != 15){
gotoAndPlay(_root.nextFram
point = newpoint;
}
else
// Set min frames
if (_root.prevFrame != 0){
gotoAndPlay(_root.prevFram
point = newpoint;
}
}
}
I only have 75 points available...Sorry.
don't be sorry ... for what? 75pts is enough, cos u have given 100% of what u have... how nice :)
i am not sure how u will like it exactly and not quite understand ur code.
anyway, u will have to have something to monitor the _xmouse continously somewho, but to "play" the prevFrame() ... u can't, u can only stop there ..
if u are using MX it will quite easy
myClip.onMouseMove = scrollFrame;
myClip.onRollOver = scrollFrame;
function scrollFrame() {
if (myClip._xmouse > WHERE_ON_UR_MOVIE_U_WANT_I T_TO_MOVE) {
myClip.prevFrame();
} else {
myClip.nextFrame();
}
}
change the if statement a little u can have it stop while in the middle of the movieclip ...
i am not sure how u will like it exactly and not quite understand ur code.
anyway, u will have to have something to monitor the _xmouse continously somewho, but to "play" the prevFrame() ... u can't, u can only stop there ..
if u are using MX it will quite easy
myClip.onMouseMove = scrollFrame;
myClip.onRollOver = scrollFrame;
function scrollFrame() {
if (myClip._xmouse > WHERE_ON_UR_MOVIE_U_WANT_I
myClip.prevFrame();
} else {
myClip.nextFrame();
}
}
change the if statement a little u can have it stop while in the middle of the movieclip ...
ASKER
Its not that because "point" is set outside of the mouseMove function...right?
My nextframe and prevframe work well,
its just that
I don't want anything to execute when the mouse is located outside of x value 114 or 435
when I test the movie, no matter where I am on the screen the movie executes, I only need it to execute when the mouse is moved over the movie.
The desired effect can be seen on
www.alexhoerner.com when moving over the girl on the left.
I'm probably going about this all wrong.
My nextframe and prevframe work well,
its just that
I don't want anything to execute when the mouse is located outside of x value 114 or 435
when I test the movie, no matter where I am on the screen the movie executes, I only need it to execute when the mouse is moved over the movie.
The desired effect can be seen on
www.alexhoerner.com when moving over the girl on the left.
I'm probably going about this all wrong.
i know what u are talking about ...
i have seen this lastnight ... man it took a long time to load so heavy ...
it is not hard at all and it is not going continously ...
if u have a series of photo which will move & look like that site, send it to me, and i can make a sample for u ... it is not hard, but not easy for beginners ...
i like that site, very clever in the making ... but ... too much too heavy and nothing much to see except that effect.
i have seen this lastnight ... man it took a long time to load so heavy ...
it is not hard at all and it is not going continously ...
if u have a series of photo which will move & look like that site, send it to me, and i can make a sample for u ... it is not hard, but not easy for beginners ...
i like that site, very clever in the making ... but ... too much too heavy and nothing much to see except that effect.
btw ... where did u guys found these sites ...?
i have a friend sent that exactly link to me last night and asked me if i could do it ...
i have a friend sent that exactly link to me last night and asked me if i could do it ...
ASKER
I found it through...
http://www.favouritewebsiteawards.com/home.html
I'm still trying to make that code work that you suggested, but I am at a loss.
Like I posted I am brand new to this.
http://www.favouritewebsiteawards.com/home.html
I'm still trying to make that code work that you suggested, but I am at a loss.
Like I posted I am brand new to this.
ok .. done ...
here's the example for u ..
http://www.smartclever.net/example/flash/mouseframe/mouseframe.swf
http://www.smartclever.net/example/flash/mouseframe/mouseframe.fla
have fun
here's the example for u ..
http://www.smartclever.net/example/flash/mouseframe/mouseframe.swf
http://www.smartclever.net/example/flash/mouseframe/mouseframe.fla
have fun
ASKER
Is there any way I can get in touch with you in the future without going through ex-ex?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if(point > newpoint && _root.nextFrame() != 15){
because you are setting point and newpoint to the _xmouse, then will always have the same value...
I don't think you want that right?
rp