Movement actionscirpt

good day!

i already finish my memory game. now i am working on this fish…

i have a fish movieclip. i use actionscript to make it move.

here is the code from kirupa.com Movement Actionscript Tutorial



fish_mc.onEnterFrame = function () {

          speed = 2;
          fish_mc._x += speed;
}

this fish is inside the aquarium, so how can i make the fish detect the width of the aquarium so it won’t go outside of the aquarium.

thank you for any help…
:pleased: