Sorry, here is the fla file: the fla
I can't find the problem from what youve told me.
and here is the code:
on the first player frame:
stop();
function onLoad()
{
playerDir = true;//true=right, false=left
gotThere = true;//if the player got to the mouse
lvrWaitForRes = false;//wait for respond for the lever
butWaitForRes = false;//wait for respond for the button
leverPulls = 0;
buttonClicked=false;
butClickChk=false;
pComingToButFromRight=false;
viewing=false;
}
_root.onMouseUp = function()
{
if(_root.treesPic._currentframe==1)
{
viewing=false;
}
storedX = _xmouse;
gotThere = false;
lvrWaitForRes=false;
butWaitForRes=false;
if(viewing==false)
{
if (storedX>player._x)
{
playerDir = true;
}
if (storedX<player._x)
{
playerDir = false;
}
}
};
_root.onEnterFrame = function()
{
if(viewing==false)
{
if (gotThere == false)
{
if (storedX>player._x)
{
player._x += 5;
if(treesPic._currentframe==1)
{
player.gotoAndStop(4);
}
if (storedX<player._x+5)
{
gotThere = true;
}
}
if (storedX<player._x)
{
player._x -= 5;
if(treesPic._currentframe==1)
{
player.gotoAndStop(3);
}
if (storedX>player._x-5)
{
gotThere = true;
}
}
if (storedX == player._x)
{
gotThere = true;
}
}
if (gotThere == true)
{
if (playerDir == true)
{
player.gotoAndStop(2);
}
if (playerDir == false)
{
player.gotoAndStop(1);
}
}
if (player._x<120)
{
player._x = 120;
gotThere = true;
}
if (player._x>480)
{
if(ham._currentframe>3)
{
_root.nextFrame();
}
player._x = 480;
gotThere = true;
}
if(player._x>button._x)
{
pComingToButFromRight=true;
}
else { pComingToButFromRight=false;
}
if (_root.treesPic._currentframe==2)
{
viewing=true;
}
}
};
on the first object frame:
lever.onRelease = function()
{
lvrWaitForRes = true;
};
lever.onEnterFrame = function()
{
if (lvrWaitForRes == true)
{
if (gotThere == true)
{
//pulling the lever
this.gotoAndPlay(2);
leverPulls += 1;
lvrWaitForRes = false;
}
}
};
belBut.onRelease = function()
{
butWaitForRes = true;
if(pComingToButFromRight == true)
{
storedX+=64;
}
if(pComingToButFromRight == false)
{
storedX-=64;
}
};
belBut.onEnterFrame = function()
{
if (butWaitForRes == true)
{
if (gotThere == true)
{
//pushing the button
//player.swapDepths(this)
if(pComingToButFromRight == true)
{
_root.button.gotoAndStop(3);
}
if(pComingToButFromRight == false)
{
_root.button.gotoAndStop(2);
}
if(buttonClicked==true)
{
buttonClicked=false;
_root.wind.gotoAndPlay(36);
_root.button.windInBut.gotoAndPlay(36);
}
else if(buttonClicked==false)
{
buttonClicked=true;
_root.wind.gotoAndPlay(2);
_root.button.windInBut.gotoAndPlay(2);
}
butWaitForRes = false;
}
}
};
wind.onRelease = function()
{
if (buttonClicked==true)
{
_root.treesPic.gotoAndStop(2);
}
}
treesPic.onRelease = function()
{
this.gotoAndStop(1);
}
ham.onEnterFrame = function()
{
this.gotoAndStop(leverPulls+1);
if(leverPulls>3)
{
this.gotoAndStop(4);
}
}
on the second player frame:
function onLoad()
{
playerDir = true;//true=right, false=left
gotThere = true;//if the player got to the mouse;
}
_root.onMouseUp = function()
{
storedX = _xmouse;
gotThere = false;
if (storedX>player._x)
{
playerDir = true;
}
if (storedX<player._x)
{
playerDir = false;
}
};
_root.onEnterFrame = function()
{
if (gotThere == false)
{
if (storedX>player._x)
{
player._x += 5;
if(treesPic._currentframe==1)
{
player.gotoAndStop(4);
}
if (storedX<player._x+5)
{
gotThere = true;
}
}
if (storedX<player._x)
{
player._x -= 5;
if(treesPic._currentframe==1)
{
player.gotoAndStop(3);
}
if (storedX>player._x-5)
{
gotThere = true;
}
}
if (storedX == player._x)
{
gotThere = true;
}
}
if (gotThere == true)
{
if (playerDir == true)
{
player.gotoAndStop(2);
}
if (playerDir == false)
{
player.gotoAndStop(1);
}
}
if (player._x<120)
{
player._x = 120;
gotThere = true;
}
if (player._x>480)
{
player._x = 480;
gotThere = true;
}
};
Thank you.
Please ignore the spam on this page.