I am relatively new to actionscrip. I know just enough to be dangerous.
I have a movieclip that is an interactive "timeline" (a graphical timeline, not timeline in flash workspace). You click and drag a sliding button across the timeline and have a slide pop in and another pop out based on where on the "timeline" you drag the sliding button. (see pix)
For the slider, I have a variable called "dragging" It evaluates at true when being dragged.
The buttons are on the same _level.* as the sliding handle. So, I want the buttons to do their thing (slide each slide in) only if the slider is being dragged. The "timelinestate" variable is so it knows which slide to slide out depending on which slide I was on last. (hence the redefinition of timelinestatus at the end.) The output window gives me errors I've posted afer the code.
if (dragging) {
if (timelinestate == 3) {
on (rollOver) {
_root.Scan_System.Content.Content_Bio.Timeline.Tim eline_Pix.Bio_Pix3_Slide.gotoAndPlay("Slide_Out");
_root.Scan_System.Content.Content_Bio.Timeline.Tim eline_Pix.Bio_Pix4_Slide.gotoAndPlay("Slide_In");
}
}
if (timelinestate == 5) {
on (rollOver) {
_root.Scan_System.Content.Content_Bio.Timeline.Tim eline_Pix.Bio_Pix5_Slide.gotoAndPlay("Slide_Out");
_root.Scan_System.Content.Content_Bio.Timeline.Tim eline_Pix.Bio_Pix4_Slide.gotoAndPlay("Slide_In");
}
}
}
timelinestate = 4;
//Error messgage that appears//:
Symbol=TimeLine, Layer=Buttons, Frame=1: Line 1: Statement must appear within on handler
if (dragging) {
Symbol=TimeLine, Layer=Buttons, Frame=1: Line 15: Statement must appear within on handler
timelinestate = 4;
Still having issues with nested code inside of if statement.
I think I have all my brackets there. I just have everything else under the if(dragging) {
\\all the other code is here.\\
}
Note that I finish all the code off with a final } that corrosponds to the if(dragging). Everything after the if(dragging) will happen if dragging is true, including the next if statement and the button action.
The last statement regarding the timelinestatus will happen after the if(dragging) is evaluated and taken care of.
I realized that since the action was on a button instance, the only thing that can be an action is a "on(someMouseEvent)" action and all my brackets have to enclose actions that pertain only to that mouse action.
My real problem is that I have two buttons on top of each other. One that drags a meter is over buttons that if dragged over, will do something.