ActionScript 2.0 :: 'If' Statement' - Goto Another Frame When Click A Button
Jan 29, 2006I need help with the 'If' statement I want it so when i click a button till the socre gets to 5 I want it to go to another frame.
View 8 RepliesI need help with the 'If' statement I want it so when i click a button till the socre gets to 5 I want it to go to another frame.
View 8 Repliesi am doing a simple project in which i have 2 frames in the main time line and a movieclip in the first frame and a button.i have something else in the second frame.when i click the button the movieclip should start after it ends the timeline should move to second frame and stop.
View 7 Repliesits a gambling game of chance and I want it to go to a random frame which will play a movie when the button "one" or the button "two" is pressed. so on each button, I have the code:
[Code]....
i created a two layer in time line in one layer there is a movieclip called mc1. In the same layer in 15th frame i have another movie clip mc2. Inside the movieclip mc2 i created another movie clip at frame10 now if i clik the the mc1 on first frame The movie clip should goto and stop at tenth frame
View 4 RepliesI have created a flash with five movie clips. I want when I press each of them to go and play specific frames on the main timeline? How can I do that?
View 1 RepliesI've seen various games where by when you start the game it gives you a scenario and 2 boxes to click, if you click a you go to frame say 57 and if you click b you goto frame 58
[code]...
I'm learning AS3 and I can't get this to work for me. In AS2 I would add a unique var to my buttons. If you clicked any of them they would just play() the main time line. Then when they got to the next keyframe it would look for the var and then go to the corresponding keyframe. How do I do this in AS3?
View 2 RepliesI am trying to make a series of images act like buttons, where each button opens a new browser window with a url of my decision. I have put in the images, converted them to symbols (buttons) and given them an instance name.
Now, the AS3. The following works for me:
Code:
btn_bent.addEventListener(MouseEvent.CLICK, buttonClickHandler_beton);
function buttonClickHandler_beton(Event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.hattingks.dk/Default.aspx?ID=6587&ProductID=9866200&VariantID=&GroupID=vogne"));
}
But I wouldn't want to make a new function for each button. I have tried to extend the function to take two parameters like:
Code:
buttonClickHandler_beton(Event:MouseEvent, www:String):void
I have a animation in my loader_mc that I want to start at one frame and play to it then stop then when you click on it again I want it to play from a certain point. But what is happening is that it will initially do everything it is supposed to but than mess up after the initial 2 clicks. Check out the onRelease event and you will see what I am currently trying to do. [URL]
View 2 RepliesI have invisible buttons on a movie clip that is loading swfs onto a parent movie clip. I hope I am current in the terminology. Are a parent and root the same? Is saying root absolute and parent relative? I'm digressing. So, this this._parent.gotoAndPlay("contact form"); is going to the keyframe named "contact form" and it will stop there. What I want to happen, is, I want the other invisible button named aboutmeMC2 to go back to the keyframe named "skip" so my contact form will no longer show up and it will load the external swf.
[Code]...
I'm pretty new to AS3 but I want to get my buttons to play the same movie then go to their button function. i.e., Picture button > play movie (same as all buttons) > picture frame.
This is the code on my buttons
ActionScript Code:
stop();
import flash.display.MovieClip;
import flash.events.MouseEvent;
var currentButton:String;
[Code] .....
Then at the end of the movie I tried using a variable to link the button to its frame
ActionScript Code:
stop();
if (currentButton == name) {
content.gotoAndStop("music");
} else if (currentButton == name) {
content.gotoAndStop("book");
} else if (currentButton == name) {
content.gotoAndStop("stereo");
}
I know the scripts messed up but not sure I really get the variable thing as yet.
I have a parent MC with all my content called GUI_MC, and on my timeline I have a Frame labelled "PAGE"
Within the GUI_MC I have a another MC for my navigation (NAV_MC)
In NAV_MC I have a button which I would like to gotoAndPlay the frame "Page" on the GUI_MC
Heres my button code:
on (release){
gotoAndPlay("PAGE");}
What do I need to add to make it goto the parent MC?.
I have a flash movie that plays through automatically pausing on each frame for a set amount of seconds.
I used the following code to pause the movie which works 100%:
stop();
var interval:Number = setInterval(
function():Void {
[Code]....
But now i have several buttons on the movie as well, now what i want to happen is that when any one of the buttons is clicked it should ignore the above piece of code and not pause on the frame but stop on the frame.
What im trying to do is play a movie clip between frames. So say we have two menus, when you are on menu 1 and you click the button for menu 2, a short movie clip plays and then you stop on menu 2. I realise I can do this by putting the movie clip on the main scene timeline, but is there anyway i can put it on the button? I think the action script would be something along the lines of "On release play MovieClip and goto frame X" As i said i want the movie to play as an almost filmic transition between menus, with a fade up and then out (Have got that bit sussed using the alpha controls)
View 3 RepliesI'm new to Flash and am looking to use the following tutorial to create an advanced button. I know it is probably a very simple fix, I just cannot figure it out. [URL] In the tutorial the rollover and onrelease has the following script this.onRollOut = function(){ rewind = true;} this.onRelease = function(){getURL [URL]); } I have tried to change the on.Release command to go to and play another frame in to movie instead of opening a new url. But I'm not getting it to work correctly.
View 4 RepliesHow do you make it so that when you click on a button named "hyperlink" it goes to a certain url?
View 5 RepliesI have a character, And in its movieclip I`ve got 3 frames (first has an idle pose, second a walking pose and third a running pose), each with a movieclip with an action in it.Well, what I wanted is that when I am walking with this character, and press the SHIFT key he runs.And I`ve got the following code
if (Key.isDown(Key.LEFT))[code]....
But when I click the shift button, he shows the first frame static of the movie clip in frame 3 (running frame).
I have four scenes, it loads on the first scene. I click the button which sould go to scene four but it goes to scene 2.
View 2 RepliesI have a movieclip in my main timeline as a menu. I want to go to a different scene in the main swf file depending on what scene I am in. Right now I'm using an if statement on the button within the menu (see below) but when I click on the button it only plays the first line of the if statement.
on (rollOver, dragOver) {
gotoAndPlay("s1");
} on (rollOut, dragOut) {
gotoAndPlay("s2");
} on (release) {
[Code] .....
there is a button on 1st frame. there is a movie clip on frame 2. I named the movie clip as "ball_mc" I want to go to frame 2 when I click on button on 1st frame. I know that the code "gotoAndPlay(2);" on button will work. But for some reasons, i want to try another way.... i tried several codes:
1. this.ball_mc.gotoAndPlay();
2. _level.ball_mc.gotoAndPlay();
3. _global.ball_mc.gotoAndPlay();
4. _root.ball_mc.gotoandPlay();
However these codes dun work. Is there other way to resolve this besides this code "gotoAndPlay(2)"?
I have 5 different buttons for the navigation on my flash website.The first page is on frame one.When you click on any of the 5 buttons I want it to play frames 10 - 15 before moving to which ever frame the button 1-5 corresponds to. So:
Click on button 1 > plays frames 10 - 15 > Goes to frame 20
Click on button 2 > plays frames 10 - 15 > Goes to frame 30
Click on button 3 > plays frames 10 - 15 > Goes to frame 40 etc
How do I make this work?
I have a small flash site made up of a number of pages all on the one timeline.
The query is this. When i release a button i want the timeline to roll on for x frames (fading components out) before going to the frame that button links to (The beginning of the new page).
I have no idea what AS to use for this.
No matter where in the timeline you are, the button should fade out that area and then skip to a new one.
Just finally making the transition from AS2 to AS3.All i need to do at this point is make two buttons which will control the movie to goto next frame and previous frame. I have gotten how to make the buttons go to a specified frame number and also a button to go to a specified external url but no success in making a simple next/previous pair of buttons.
stop();
but1.addEventListener(
MouseEvent.MOUSE_UP,
[code]....
When you click a button I want my flash to go to the frame label where the movie clip is located, and then play a certain frame of that movie clip.
View 5 Repliesat first, I thought I could manage this myself searching the forums about "preloader" but none of the solutions seem to work. I think it has to do with the fact that I'm using the FLVPlayer with an external file. What am I looking for?
1. Well, the preload code for frame 1 that makes sure the external F4V (movie.f4v in the same dir) is loaded 100% before it jumps to frame 2 where the movie should start playing...
2. If possible, a progress bar.
It's the simplest thing: I have a button. I want to click the button, and go to the next scene frame 1. I made my own button. AS 2.0 was so simple with it's code. I having a very difficult time with the code. I'm an artist, not a code guy.
View 3 RepliesI got these codes on the web, but they're not working. (I'm pretty new to flash).[code]...
View 20 RepliesWhat is the best (or the only way) to get a button in actionscript 3 to when clicked (released) jump to a specified frame label. I've seen a fair amount of little tutorials out there that can tell you how to link to a URL but not within the flash file itself.
View 6 RepliesSo what I have is this: 1 frame with stop(); action and 1 button. To the button I added the action on (release){ gotoAndPlay(2);} so that it plays frame 2. Frame 2 through 6 is a simple motion tween, with the stop action at the end. Yet, when I click the button it takes me to frame 2, but the motion tween doesn't play.
View 1 Repliesi put a code in to Flash AS3 to go to another frame when the play button is clicked, and it has worked successfully. But when it goes on to the other frame and i click, the play button comes up and keeps making the game i've made restart. Does anyone know how i can stop the function after it's gone onto the next frame?
[Code]...