I know by this point everyone on here has to be beating their heads against the wall anytime I post. I do really appreciate all of your help though. More than you will ever know. So I simplified the code down to a few lines. Of course this brings up new questions. Here is my new code:
addEventListener(Event.ENTER_FRAME,scrollmc1 );
function scrollmc1(event:Event):void
{
mc.x += (mouseX - mc.x) * 0.04;
mc.y +=(mouseY - mc.y) *0.04;
}
It seems to work much better and smoother than before. It is a alot more simple. My new question is 2 parts.
1. How do I get it to stop scrolling when the movie clip edge lines up with the edge of the screen (so it doesn't just scroll into a white stage).
2. How do I get this effect to only happen when the user scrolls toward the edges of the screen?
Thanks again. You guys are awesome and so so patient. Thank you.
Use conditionals to control how far the object can move. Only allow your movement code to work if the object is not yet to its limit. Basically something like...
function scrollmc1(event:Event):void
{
if(mc.x < upperlimit){
mc.x += (mouseX - mc.x) * 0.04;
mc.y +=(mouseY - mc.y) *0.04;
}
}
As far as only allowing the movement to occur when the mouse is at the edge, a similar approach can be taken, something like...
function scrollmc1(event:Event):void
{
if(mc.x < upperlimit && (mouseX > rightboundary || mouseY > bottomboundary ){
mc.x += (mouseX - mc.x) * 0.04;
mc.y +=(mouseY - mc.y) *0.04;
}
}