ActionScript 2.0 :: Using Simple Frame Label Buttons With A Twist
Mar 22, 2007
I designed a navigation menu that has 4 buttons. When you rollOver btn1 it goes to a nested movie clip and plays the frame label "a1" which changes its color. On rollOut it plays the "a2" which restores it to its original color. Very easy so far and common. onRelease the button is instructed to stay a a1 to indicate its on.Here is the twist. When you roll over btn1 part of the animation covers up the other buttons. Same thing is you roll on btn2 for example, it colors the buttons accordingly. So I started off by creating a variable and setting it to 0. Then I built my rollOver, rollOut, & onRelease code for each button and said if the variable is not != to whatever number then play the frame label using that logic but it has failed to fully work. The other button even though its covered up with a different color still works so it just makes a sort of glitch.[code]
1. I make a simple movie (call it movieClip) first frame has stop(); action, second frame has label playMovie, last frame has action gotoAndPlay(2); (so that movie not stop anymore2. Now I place movieClip on stage3. Question... what is code to make movieClip play frame label playMovie?
I already try to put many different type action in frame one of stage this.movieClip.gotoAndPlay("2"); //NOT WORK this.movieClip.gotoAndPlay(2); //NOT WORK
Is there any way to click on a button (or movieclip) in Flash and somehow get the current framelabel that the instance happens to be on? my_button_instance.addEventListener(MouseEvent.CLICK, clickInstance, false, 0, true); private function clickInstance(e:MouseEvent):void { trace(trace-out-the-frame-label-here?); }
Is it possible to change a frame label within a gotoAndStop('label') with the parameters in a function?I'm playing around with updating code as I learn more and more techniques, and at the moment the code is a basic click-a-button to select the object shape, and on press the button disappears:
// Change the object into a circle. circle_btn.addEventListener(MouseEvent.CLICK,function(){changeShape_fun(circle_btn,circle);}); // Change the object into a square. square_btn.addEventListener(MouseEvent.CLICK,function(){changeShape_fun(square_btn,square);});
[code]....
However I can't/don't seem to know how to change a frame label through function parameters, or if what I'm trying to do is even possible.Also to note, while I'm all ears for any more efficient ways of doing what I'm trying to do, I would still like to know how/if you can change frame labels through function parmeters.
I'm getting the "Label must be a simple identifier" when trying to add to my arraywhy?
// var roundOne: set outside of function on main timeline // var allRoundWinners:Array ; is declared outside of the function on main timeline // both reside where all the code is created.. frame 1 -> layer "actions".
I'd like to first say that I can program in C++ but this is a little new to me. So I did an internet search for this problem and I received "the main reason you get this error" and a couple other suggestions but never does it say what the error exactly means. why one would get the Label must be a simple identifier error on this line of code?
I need to create an array inside a movieclip, so: var Container:MovieClip = new Movieclip; Then how do I make an array inside of the that movieclip. I've tried Container.mCONTENT:Array = []; But I get "Label must be a simple identifier"
I'm having trouble referring to a dynamically generated variable...
ActionScript Code: for (z=1;z<=3;z++){[code]....
The Quartz class is an extension to the movieClip class. It adds an image to the stage. I want to be able to write code to add 3 images (without having to do it manually) and access their x and y properties.The error on is for line 2 and says: error 1078: Label must be a simple identifier.
nextTX.onRelease = function (){var nextFrameLabelNum:Number = (1+Math.round(thTX._currentframe/27))%10; thTX.gotoAndPlay("next "+nextFrameLabelNum); }[code].....
which works great IF I am moving one image at a time.What I have done now is tween 3 slides to move into a visible mask by pressing next, but when I press previous of course the above doesn't work.It just jumps to the previous three with no tween.I would like to maintain the tween but in reverse.I would like the previous just to undo, in reverse, what the next button just did with the tween?Is there anyway to make this happen with as 2.0?
if its possible, via AS3, to create a frame label in a movieclip on a specific frame.
Obviously I can do it by manually by setting up labels on the timeline within the target movieclip, but I would rather use an array so I can loop through it, creating a label name on a the specific frame each time?
so for example I would end up with: myLabelOne on frame 10 myLabelTwo on frame 25 myLabelThree on frame 115 etc
I am trying to use this if statement with a frame label instead of a frame number. I believe that _currentframe is looking for a number only. Is there a different command that looks at frame labels instead of frame numbers?
is it possible to find the frame number of frame label with AS if a button is rolled over, the timeline jumps to a label - which plays a set of 3D rendered frames to 'raise' and element, once a user rolls out of the 'button' area the button is meant to 'lower' - which can be done by simply playing backwards to the previous label.
I am trying to use this if statement with a frame label instead of a frame number. I believe that _currentframe is looking for a number only. Is there a different command that looks at frame labels instead of frame numbers?
In brief, the goal is to allow the user to drag any of the balls to any of the drop targets, change their mind and replace them again, but if they are not over one of the drop targets the ball being dragged will bounce back to its original location.Secondly, if the user drops one of the balls on to a drop target that has another ball already there, it will replace that ball and send it back to its original position.
Finally, while the user is dragging a ball, if they release the mouse button while their cursor is outside of the restricted drag area, the ball will return to it original position. This I have working with ActionScript Code:
I am creating an online demo which has 5 scenes that play one after another. My goal is to load the 1st scene while the user waits. Once the 1st scene starts to play, the 2nd scene begins downloading quietly in the background. That way, once the 1st scene is complete, it will automiatically play the second scene, the viewer none the wiser. I don't have any user interaction here.
on (press) { _parent._parent.gotoAndPlay(19); }[code]....
it will work? My labeled frame is two parent mc's previous and it doesnt work when I call to it with the label?I would really like to use the label so if I move my keyframes around I dont have to change a lot of code.....
I have three buttons, btn_1,btn_2,btn_3, and two movie clips, image_1,image_2. The names listed btn_1,btn_2,btn_3, image_1,image_2. are all instance names. All buttons and movie clips are on their own layer in a single frame on the main time line. the movie clips have a stop action on the first and last frame, with a frame label, on the first frame in the sub time line. For image_1 the frame label is image_1_1 and for image_2 the frame label is image_2_1.
I would like btn_1 and btn_2 to control the movie clips, image_1,image_2. Either button should be able to close the other buttons movie clip and play it's own movie clip. Also i am trying to make the movie clips themselves have the ability to be closed by clicking on the movie clip image area that is playing. Both movie clips when not playing hide behind the appropriate button with an alfa of 0.
When playing they expand to the middle of the window and are at 100% alfa, using a tween. The third button, btn_3 should only be visible when one or the other movie clisp are playing. btn_3 dose nothing else but this for now. As of now, my movies continuously loop and btn_3 is always visible. I can't seem to figure this out. my code for this action is:
I have a tic-tac-toe game. Where the user would which spot they would want to put their X or O in and then they would go to a random question. That's where my problem starts. How do I get it to go to a random question?[code]This is what I tried using. It works, but it only goes to QuestionOne. I tried putting a comma to seperate the labels, but that just makes it play the whole movie.
Following the common rules, I'd like to put all my as2 code in the first frame of a layer named "code". Then this question occurred: how to implement that "taking some actions when a specified frame(best using "frame label" not "frame index number") entered" in the "code frame" using as2. what i can call to mind is listen the enter frame message of the current MC, but how can i check if the current entered frame is the specified frame?