ActionScript help!
iHatePopUps
Singapore
Ok, here's a problem that has got me pretty beat. I'm making a Flash movieclip animate from left to right and vice versa (think a scrolling pic gallery) when a mouse 'Rollsover' a certain area in my file, and i've got the 'scrolling' effects to work. Problem is, whenever it scrolls to the left, it will scroll all the way back to frame 1 of the layer, which is not what I want. I'm trying to make it stop scrolling when my mouse 'rolls out' of the detection area. I've plucked the following code from a website, and currently trying to change it to accomplish this. Hope someone can help. Here's the code:
stop();
Mouse.addListener(this);
var totalFrame = pics_mc._totalframes;
scrollarealeft.onRollOver = function()
{
pics_mc.onEnterFrame = function() {
if (pics_mc._currentframe>1) {
pics_mc.prevFrame();
if (pics_mc._currentframe == 1){
pics_mc._currentframe = 1;
}
}
else {
delete this.onEnterFrame;
}
};
}
scrollarealeft.onRollOut = function(){
delete this.onEnterFrame;
pics_mc.gotoAndStop(pics_mc._currentframe);
}
scrollarealeft.onRollOut = function()
{
pics_mc.gotoAndStop(pics_mc._currentframe);
dunstopMe = false;
}
scrollarearight.onRollOver = function()
{
pics_mc.gotoAndPlay(pics_mc._currentframe + 1);
if (pics_mc._currentframe == totalFrame){
pics_mc._currentframe =totalFrame;
}
}
scrollarearight.onRollOut = function()
{
pics_mc.gotoAndStop(pics_mc._currentframe);
}
I know i've gotta get rid of that "if (pics_mc._currentframe>1)" section as it will loop until the frame number is 1, but how should i modify it?
any help and/or advice to modify or change the code will be much appreciated. Also, if there's an easier way to do this, I'd love to know too.
stop();
Mouse.addListener(this);
var totalFrame = pics_mc._totalframes;
scrollarealeft.onRollOver = function()
{
pics_mc.onEnterFrame = function() {
if (pics_mc._currentframe>1) {
pics_mc.prevFrame();
if (pics_mc._currentframe == 1){
pics_mc._currentframe = 1;
}
}
else {
delete this.onEnterFrame;
}
};
}
scrollarealeft.onRollOut = function(){
delete this.onEnterFrame;
pics_mc.gotoAndStop(pics_mc._currentframe);
}
scrollarealeft.onRollOut = function()
{
pics_mc.gotoAndStop(pics_mc._currentframe);
dunstopMe = false;
}
scrollarearight.onRollOver = function()
{
pics_mc.gotoAndPlay(pics_mc._currentframe + 1);
if (pics_mc._currentframe == totalFrame){
pics_mc._currentframe =totalFrame;
}
}
scrollarearight.onRollOut = function()
{
pics_mc.gotoAndStop(pics_mc._currentframe);
}
I know i've gotta get rid of that "if (pics_mc._currentframe>1)" section as it will loop until the frame number is 1, but how should i modify it?
any help and/or advice to modify or change the code will be much appreciated. Also, if there's an easier way to do this, I'd love to know too.
0
Comments