If statements attatched to a button?

I am attempting to create a web site entirely in flash, , I am having trouble navigating within scenes. I have a movie clip within the main scene which is triggered once it gets to a certain frame within the scene, the movie clip features a small animation which simulates the scrolling of a 3 txt items, it is controlled by 2 buttons, one which will show the next txt item, and one which will show the previous txt item. This works fine, but I would like to have it interacting with a button I have in the main scene, whereby, if in the scrolling mc (called RemoteControl) the first scene is played (first txt item) on release the button will cause a new frame to be played,

on (release) {
&nbsp &nbsp &nbsp &nbsp targetPath(“RemoteControl”);
&nbsp &nbsp &nbsp &nbsp ifFrameLoaded (1) {
&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp gotoAndStop (“player”, 3);
else
ifFrameLoaded(2)
gotoAndStop(“player”, 4);
else
ifFrameLoaded(3)
gotoAndStop(“player”, 5)
}

I know syntax is incorrect I quickly typed it so you can get an idea of what I want to do. I have worked out that the ifFrameLoaded does not work with the else statement, but I cannot think of how else to do this, I hope you can understand what I am trying to do, please, please get back to me with any help you could offer.
Thanks
Laura

put a variable in the onEnterFrame action of all your frames (same one), first frame var=1, 2nd var =2 and so on, and in your if statement, just check the content of var (with the correct path). Can you handle this?

hi eyezberg, thank you for your quick reply, I understand the theory, but I have been messing about with creating the variables, and to be honest I have no idea what I am doing, well it hasnt worked yet anyway. If you have some time is it possible to elaborate further?
Thank you
Laura

ifFramesLoaded refers to whether a frame has downloaded yet or not. this is not quite what you want (right?), rather you’re looking to see what frame is currently being displayed in the txt movie. try using:

  
if(_root.txt._currentframe==1){
   ... do this ...
else if(_root.txt._currentframe==2){
   ... do that ...
}

eyezberg’s method is neater though, in each frame of txt write:

  
frametarg = 3;

except change “3” to equal whatever is appropriate, then in the button:

  
gotoAndStop(_root.txt.frametarg);

and since i’m on a roll, here’s another method using my favourite data structure - arrays! in frame 1 of _root:

  
frametarg=[3,5,2];

and then in the button:

  
gotoAndStop(_root.frametarg[_root.txt._currentframe-1]);

that’s really getting a little carried away though. ; )