Vertical Scrolling image problem with scripting

Hi experts,
I have some problem with the vertical image scrolling.
When take mouse pointer in the +y-axis the image scroll perfectly and duplicating also works fine.
But when i take the mouse pointer in -y-axis the duplicating movie clip doesn't seems working

 I have a movieClip instance name : myMoviemc, Inside this movieClip I have two layers
1st i have the following actionScript

[CODE]
      movieh = 400;
      h = foto._height;
      speed = 12;

this.onEnterFrame =function() {
      ypos = _parent._ymouse;
      ypos = ypos-(movieh/2);
      foto._y =  foto._y-(ypos/speed);
}
[/CODE]

2nd Layer:
I have a image movieClip, instance name:foto
in side this movieClip i have two more layer


 1st layer : i have the following actionscript.
// duplico il movie clip principale della foto in due e li metto uno sopra e uno sotto
[CODE]
m = 0;
tmi = 2;
while (m<(tmi*2)-2) {
      m++;
      dup = 'image' + m;
      _parent.foto.image.duplicateMovieClip(dup, m+1);
      _parent.foto.image1._y = _parent.foto.image._y+_parent.foto.image._height;
      _parent.foto.image2._y = _parent.foto.image._y-_parent.foto.image._height;
}
[/CODE]

2nd Layer : anohter movieClip instance name: image
on image movieClip i have the following script.

[CODE]
onClipEvent (enterFrame) {
      // truschino per simulare lo scorrimento infinito
      if (_parent._parent.foto._y<-_parent._parent.foto.image._height/2) {
            // trace("a");
            _parent._parent.foto._y = _parent._parent.foto._height/2;
      } else if (_root.foto._y>(_parent._parent.foto._height/2)-8) {
            _parent._parent.foto._y = _parent._parent.foto.image1._height/2;
      }
}

[/CODE]
Please help.
I have also attached the fla,
Note : please rename the drag.jpg to drag.fla

drag.jpg
LVL 2
skilleddesignerAsked:
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.

iamlfetchCommented:
You made a reference error on the image instance.

replace
[CODE]
onClipEvent (enterFrame) {
      // truschino per simulare lo scorrimento infinito
      if (_parent._parent.foto._y<-_parent._parent.foto.image._height/2) {
            // trace("a");
            _parent._parent.foto._y = _parent._parent.foto._height/2;
      } else if (_root.foto._y>(_parent._parent.foto._height/2)-8) {
            _parent._parent.foto._y = _parent._parent.foto.image1._height/2;
      }
}

[/CODE]
with
[CODE]
onClipEvent (enterFrame) {
      // truschino per simulare lo scorrimento infinito
      if (_parent._parent.foto._y<-_parent._parent.foto.image._height/2) {
            _parent._parent.foto._y = _parent._parent.foto._height/2;
      } else if (_parent._parent.foto._y>(_parent._parent.foto._height/2)) {
            _parent._parent.foto._y = _parent._parent.foto.image1._height/2;
      }
}

[/CODE]

all i did was change the _root to _parent._parent :)
0

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
skilleddesignerAuthor Commented:
thanks,
i guess i missed that out :)
0
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.