Paused Statement & Button Statements
May 5, 2009
How do you script a Pause of X Seconds on X Frame and also on that frame have a button release statement that can take you forwards or take you backwards, elsewhere in the timeline - Without affecting the 'Pause' statement... therefore not mucking up the timeline and causing it to jump around at the end when all catches up?I take it once a pause has taken place - a button that can take you elsewhere, if clicked on - does not Cancel the initial pause and therefore lies my problem?
View 3 Replies
Similar Posts:
Dec 27, 2009
I have a if statement that first checks to see if the enter key is pressed. Although i cant figure out how to to nest futher statements with in that initial statement. At the moment I'm checking for an enter keypress like so:if (Key.isDown(Key.ENTER))I suppose immediately after i want the script to see if a a textboxes variable is empty or not.IF its empty run x code.IF it has content run y code.Seems straight forward enough but i cant seem to figure out how to nest them under the first Enter key IF check.
View 3 Replies
Feb 14, 2011
My Original Post:I have been designing a visual presentation in Flash CS5, there are a few movie clips on the stage that are set to play at a certain time/frame. The problem I am having is that I am not familiar with coding/actions. I want to have a play and a pause button so I can pause at any point (not a specified frame) and discuss with the audience. Then I want to be able to click the play button to resume from that point (wherever I paused from). I hope to get help and be able to learn from your answers. I don't know how clear my question is, but I can clarify if you need me to... A Reply:you can stop/play any movieclip by using the movieclip's reference:
[Code]...
View 1 Replies
Apr 25, 2009
I'm trying to make a "next track" button. "T" is meant to be track number, and every time they click this button, I wanted "T" to increase by one until T>4 where I need it to go back to T=1 (I've only got 4 tracks). Then, I want, depending on what "T" equals, for it to start playing Track"T" and stop playing previous track. I also want the track playing to be looping continuously. At the moment, everything is muted, until I press the button; where it then plays all four tracks at once. I also have a problem with the mute button, but I've got a strong feeling both are of the same reason. I think my problem is that it does not know what "T" equals to begin with so it accepts all if statements; playing all tracks. But I'm new to Flash (my second project) so I'm not sure.
on (release){
stopAllSounds();
T =T+1
if (T>4){
T=1
} if (T = 1){
_root.snd1.start(0, 100);
[Code] .....
View 3 Replies
Aug 30, 2009
This time I am trying to use button functions with in IF statements. However I am having trouble with the if statements regonizing the currentFrame(); or currentFrameLabel();. I want diffrent button functions depending on what frame the playhead is in. But the frames are in diffrent movieclips and what not.The next problem is that I do not full understand the way to do frame paths (IE Root.Movieclip.Movieclip) in AS3. series of tutorials that I could read and follow,
View 12 Replies
Apr 13, 2010
I'm trying to create a script that will disable a button after its been clicked, and once a certian number of buttons has been clicked, it takes you to a certian frame. All this takes place inside a movie clip.
[Code]...
View 1 Replies
Jun 24, 2004
i'm trying to use if statements but can't get this thing to work i want to check if another button is visible on release of a button to determine what action to be taken.the 'gotoAndPlay("firstscene",1)' is just there as an outcome, will be changed later. anyway this is the code i've got on the button i'm pressing. blobyellow2 is an instance of a button blobyellow is it because it's an instance that it's not working?
[Code]...
edit: sorry forgot to put what's wrong with the code. it acts as though the statement is correct no matter if it is or isn't.
View 11 Replies
Jun 14, 2004
I have three buttons: each one changes a variable to a name: one, two and three and plays the movie.when the movie gets to frame 100, it should get the variable and play the label with the same name of the button...How should be the AS of this frame so it plays to the correct label?
View 1 Replies
Oct 7, 2004
If they get a question wrong in my quiz ( weakest link) the money clip goes to zero and it goes onto the next question. If they get it right the money clip advances and they go onto the next question. I want to include each time that it should only go onto the next question if all questions have been asked. SO i want an extra if clause in both sections, saying if current question is more than 11 go to '#game over"The questions are saved in the frame of the quiz
_root.qArray = new Array("question: A;B;C;D")
_root.qArray.push("Question?:A;B; C; D")
There are 11 questions.At the moment at the section with choosing answers I have
function selectAnswer(n) {
// correct
if (answers[n] == correctAnswer) {
_root.money.nextFrame();
[code].....
View 1 Replies
Feb 15, 2007
I'm trying assign two functions to one button. The first click does a loadMovieNum to level 1. The second click will unloadMovieNum on level 1. So the first click loads a movie, the second click unloads it. Pretty basic.
I'm guessing it's a simple if statement, but I don't know how to go about it.
Anyone want to take a stab?
View 6 Replies
Oct 20, 2006
I've done some searching on the subject but haven't found an answer except for if you have Flash Media Server which I don'tHow can you detect if a flv is paused?
View 1 Replies
Jul 7, 2005
I have a button which controls the horizontal movement of a movie clip and next to it I have a button, if the user clicks the button once it moves up half way and when they click it again I would like for it to move up the rest of the way.This script has been applied to the button
on (release) {
if (xpos = 0) {
trig.xposnew = -396;
[code]....
View 4 Replies
Oct 7, 2008
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.
View 1 Replies
Apr 6, 2009
'm trying to write an if/else statement for a mc button that says if mc is on stage don't attach it, else attach it.
View 5 Replies
Nov 13, 2009
i have built a .flv video player and its working just fine but when it loads videos they start off stopped with a play button overlay so it has to be user initiated to start. Only problem is when they are paused at the beginning of the stream they are invisible. I have tried several things to make the video appear at the beginning but nothing works.
i have tried explicitally setting the visible and alpha props. they dont do anythign (the vid is already visible and alpha = 1 according to traces) i have tried seek(0.1) to seek ahead a bit - this doesn't work at all. tried playing and pausing the stream but that no workey either.
View 1 Replies
May 12, 2009
i have 9 images. the one that loads in is based on the number established by the variable loopCount, which increases by 1 each time the main movie loops. Based on what value loopCount has at the time, i want a matching button to appear. For example:
loopCount has the number 5 assigned to it this time around image 5 loads in button 5 needs to load in to match. i am guessing its some simple if statement, but i am at a loss. here is my attempt at the code:
[Code]...
View 1 Replies
Feb 27, 2010
I am having a problem using an if statement in a button. What I want to do is go to a frame dependent on which frame we are already on. For example if I am on frame one and I press the button the first time it will take me to frame five, if I then press the button a second time the actionscript detects we are on frame five so goes to frame ten and so on.
ActionScript Code:
on (release) {
gotoAndPlay(5);
if (currentframe == 5) {
gotoAndPlay(10);
} else if (currentframe == 10) {
gotoAndPlay(15);
} else if (currentframe == 15) {
gotoAndPlay(20);
}}
When I first press the button it takes me to frame 5, the second time I press it goes to frame 10, but when I press after that instead of going to 15 it takes me back to 5 then 10 then 5 then 10 etc and is stuck between going from 5 to 10 and back again.
View 8 Replies
Aug 23, 2011
I have an exam game with different categories of test, all linking to a single results page. I would like to be able to set the back button to return the user to the main page for category they were just in, in case they want to retake the test, or take another part of the test, as some are broken up into multiple parts. I imagine there must be a way to detect what test category the user came from and program an If statement that sets the back button direct them to the main test page/frame. Something like, if user comes from Test1, btnBack=mainTest1, else if Test2, btnBack=mainTest2, etc.
Clearly not the right syntax, but something along those lines in terms of function. I understand how these statements work, but I have just never written one from scratch before, or really done much of anything with them; and have no idea where to begin. At the very least, could anyone direct me to a reliable, easy to follow guide somewhere online that would point me in the right direction? I've seen some guides, but they're not always the easiest to follow, if you've never done what they're instructing you to do, before.
View 9 Replies
Oct 22, 2003
This is what I get in the output window:
Statement must appear within on handler
back_button.onRelease =function () {
View 6 Replies
Sep 9, 2003
I have this email form. Click on the bottom where it says submit track.It takes you to a form section.On that button i have an if statement, but it doesnt work.I only want the playhead to play when all 3 fields have been filled out, i thought i had it right, but i was wrong
View 7 Replies
Oct 22, 2003
This is what I get in the output window: Statement must appear within on handler back_button.onRelease =function () {
View 7 Replies
Aug 14, 2009
I DO NOT KNOW FLASH - let's just get that straight. I do not know actionscript, and I'm not familiar ith the interface. But I do know how to open a document, drag a .flv into the frame, add a playback skin, and save a swf for use on a web page.
The problem is that the videos all start playing on default. I'd like the user to have to hit the "play" button to play the video so that they are not inundated with sound when the page loads.
View 2 Replies
Nov 30, 2010
I just made it clear of the differences between the progressive video and streaming video *^_^* But I do need a feature of allowing buffering the video when it's paused, which I cannot find how to do it directly... I followed an article ( url...) to manage the buffer strategy but it didn't solve my problem. My problem is: if the user has a very slow network condition, he/she might want to just pause the video manually, and wait it to be downloaded until it's 'pretty much', and he/she can watch it without interrupting. But I notice that, when I pause the video, the event "NetStream.Buffer.Flush" is triggered. And according to the language reference: "Data has finished streaming, and the remaining buffer will be emptied.", I have to re-buffer it, right? However, also according to the reference, it shouldn't stop buffering:Starting with Flash Player 9.0.115.0, Flash Player no longer clears the buffer when NetStream.pause() is called. This behavior is called "smart pause". Before Flash Player 9.0.115.0, Flash Player waited for the buffer to fill up before resuming playback, which often caused a delay. I'm using Flash Professional to do the debugging, and the traced version number is: MAC 10,0,22,91; and for the streaming server, I use red5.
View 1 Replies
Nov 9, 2011
I have created a player that loads video FLV files and plays them in a sequence. On loading the videos I retrieve the total video time by stream.client.onMetaData = ns_onMetaData;" and in an EnterFrame event I check whether the video playtime is equal the totaltime. If the video playtime is equal to the totaltime then the player loads the next video. Sometime, even if the video ends, the playtime and total time doesn't match. So to fix the issue, I decided to put an event cue point (END) at end of each video FLV. So whenever the FLV fires the END event, the player removes the current video and loads the next one.
Suppose the video total time is 44:00. The cue point is also at 44:00 in the FLV. So whenever the player gets the END event from the FLV then it loads the next one. Now the issue is, if I pause the video at 42:00 and wait for 2 sec, the player gets the END cue point and jumps to the next video. When I paused the video the timer says "42:00 of 44:00". The timer doesn't increase, that means the video has actually paused. But I still don't understand that why I'm getting the END cue point where the video has not reached the time.
View 1 Replies
Nov 28, 2010
just made it clear of the differences between the progressive video and streaming video *^.^*
But I do need a feature of allowing buffering the video when it's paused, which I cannot find how to do it directly...
I followed an article (I'm not able to post the url) to manage the buffer strategy but it didn't solve my problem.
My problem is: if the user has a very slow network condition, he/she might want to just pause the video manually, and wait it to be downloaded until it's 'pretty much', and he/she can watch it without interrupting.
But I notice that, when I pause the video, the event "NetStream.Buffer.Flush" is triggered. And according to the language reference: "Data has finished streaming, and the remaining buffer will be emptied.", I have to re-buffer it, right?
I really expect the "buffer when paused" functionality, is it possible to do?
p.s. I'm using red5, not fms, although I haven't touched the difference part of them.
View 3 Replies
Jan 8, 2007
Is there a way to do this? I want it to pauseplay toggle when you click it, but the only property I can find is "playing" which evaluates to true unless the movie is stopped, which means the playhead is back at the start.
View 2 Replies
May 14, 2009
Having a few problems with what I thought was a simple if statement. Here is the code:
[Code]...
I can't quite figure out the small problem with the code. It seems to just bypass the first requirement of the if statement when I do type in the proper input and go straight to the else statement.
View 7 Replies
Nov 25, 2009
Here is my current small piece of code I have on a given "letter" button..
on (release) { if (_root.Acheckmark._visible=true) { _root.AScore = _root.AScore+_root.APoints; } else if (_root.Bcheckmark._visible-true) { _root.BScore = _root.BScore+_root.BPoints; }}
View 1 Replies
Jan 29, 2009
I want to change a variable when a button is pressed. lingo: if this button is pressed then check varexample what number it has if it has a number then gotoAndPlay("example") and add 1 to varexample else, do nothing I'm sure if I get this kind of example down, I'll be able to figure the rest out by myself. =S
View 5 Replies
Mar 2, 2011
I've been struggling with an issue for a while now and can't find a solution. I've got a series of movieclip buttons that I have going between states on ROLL_OVER, ROLL_OUT and CLICKED. It's very straightforward - except for the fact that I can't get the CLICKED function to take precedence over the ROLL_OUT and I was wondering if there was a way to make the ROLL_OUT conditional on the click. ex:
ActionScript Code:
//this is coded on a series of 5 buttons, only 1 is shown as example:
paintings2000_but.addEventListener(MouseEvent.ROLL_OVER,onPaintingsOver);
function onPaintingsOver(state)
[Code]....
So my issue is that I need the ROLL_OUT to be conditional based on whether someone has clicked the button or not; but I can't find a solution for how to do that in this context!
View 3 Replies