Letting Sounds Play On A Specific Frame Before Continuing
i have a frame of animation that when the playhead reaches it, i want to play the complete sound before continuing. what is the proper actionscript for that. If it is important, the frame right after the frame with the sound has a "stopallsounds" script so that the sound doesn't loop over on top of itself.
FlashKit > Flash Help > Flash Newbies
Posted on: 02-19-2003, 12:56 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
[CS3] [AS 3.0] Go To And Play From Specific Frame
Hey,
I am very new to Flash. I did some searches on here but got confused.
I have a button and am simply trying to go to a specific frame and play from that frame when the button is pushed.
How would I do that and where would I write the code?
Play A Frame On Specific URL
The idea is to make a script that if specific URL is loaded to play some frame?
How to do it? Is it possible?
Thanks
Play Animation From Specific Frame
In one animation i call two swf files... and the code is....
Frame 1
-------
tank2.loadMovie("tank2.swf");
tank1.loadMovie("tank1.swf");
Frame 3
-------
if(tank2.done == true){
tank1.gotoAndPlay(5);
}
else{
gotoAndPlay(2);
}
Frame 5
-------
if(tank1.done == true){
tank2.gotoAndPlay(2);
}
else{
gotoAndPlay(4);
}
This is loopable animation when one file playing completes then other file plays. But i want this plays normally first time but on first loop the tank2 will start from the Frame 20 not from the frame1. Please tell me this is possible or not. Because preloaders are created in the tank1 and tank2 and on loops those
are also visible for a second.
[F8] How To Go To And Play A Specific Frame In A Loaded Swf
Hola...
I'm trying to figure out how to automatically goto and play a specific frame in a loaded swf file after it has been loaded. I'm just not sure how to define the path. i.e _root.gotoAndPlay();, myMovieClipLoader.gotoAndPlay();, importedSwf.gotoAndPlay();
importedSwf meaning the name of the file i am importing
myMovieClipLoader is the variable
_root...well...root
any help would be awesome
Can't Load Swf And Play Specific Frame...
Hi,
For some reason I can't get this to work. "company.swf" loads, but it doesn't find the frame labeled "news". It just plays frame 1.
Code:
this.unloadMovie(1);
loadMovieNum("company.swf", 1);
_level1.gotoAndPlay("news");
am i doing something wrong?
Unloadmovienum Then Play A Specific Frame?
Main movie loads external swf file. With in that external file I want a button that unloads the external file and gotoandplay's to a specific scene and frame.
This is what I've tried, only unloads movie, does not go to the location.
on (release) {
unloadMovieNum(5);
gotoAndPlay("Gallery", 11);
}
Any help very appreciated.
Thanks.
Directing An Swf To Play In A Specific Frame Of An Exe
I have a Flash movie which I publish as a projector (exe) file—am working in Flash MX. I have five swfs that are linked to buttons on the home page of the exe. The buttons live in the lower two-thirds of the home page. When you click a button, an swf is loaded and plays within an empty movie clip on the home page. The empty mc is also in the lower two-thirds of the home page screen—so that the main navigation at the top is always visible.
The script I am using to call up the swfs from the exe is:
ActionScript Code:
on (press) {
fscommand ("exec", "undergrad4.swf");
}
on (release) {
loadMovie("undergrad4.swf","video_mc");
}
(video_mc is the empty movie clip in the exe. undergrad4.swf is one of the five swfs)
All this works fine. However there is a major problem. As the swf is playing, the buttons on the underlying home page remain active. Thus, if you run the mouse over a part of the swf that does not have any links, but that sits directly over an underlying button, the cursor becomes active and people will click it. The result is they are taken to another swf. This is not the way it’s supposed to work!
My question is how do I defeat this problem? So far, I have not been able to find a solution. I have been searching the forums for help—but as my scripting it not that advanced, I may be looking at a solution without understanding it!
One thought I had was to create a frame within the exe timeline that had all the elements of the home page including the upper third navigation, but not the buttons. But how do I direct the swf to play within that specific frame of the home page timeline?
I would appreciate any and all help. Thanks.
Play And Stop On Specific Frame
I have a movie clip of a robot (i made in swift 3D) that spins around in flash. Its instance name is "tachi". It has 29 frames in the movie clip.
I have some buttons on the main timeline:
On button 1 release, I need the movieclip to play from frame 29 and go backwards to frame 15 and stop.
(15 <---------- 29)
On button 2 release, I need the movieclip to play from frame 15 to 25 and stop.
(15 --------->25)
The rest of the buttons I will have go to other frames once I figure out how its done. The thing is, I cant put stop frames on the movieclip's timeline, I need the actionscript to make it play to and stop on certain frames.
Would anyone know how to do this? Thanks if you can help.
Possible To Play In Reverse To A Specific Frame?
I'm trying to figure out if it's possible to play a timeline in reverse to specific frames. I would have split it up into seperate movie clips, but because of the way i needed to line things up, it's easier to edit it with everything on one time line. I've got labeled frames for jumping around the timeline, i'm just trying to figure out how to go in reverse to specific frames. prevFrame() works except it plays backwards all the way to the beginning, it has no parameters to control it. So does anyone know another method? Thanks for any input.
Possible To Play In Reverse To A Specific Frame?
I'm trying to figure out if it's possible to play a timeline in reverse to specific frames. I would have split it up into seperate movie clips, but because of the way i needed to line things up, it's easier to edit it with everything on one time line. I've got labeled frames for jumping around the timeline, i'm just trying to figure out how to go in reverse to specific frames. prevFrame() works except it plays backwards all the way to the beginning, it has no parameters to control it. So does anyone know another method? Thanks for any input.
Play External Swf At Specific Frame
using flash mx2004, i am building a website for a photographer, so it's image heavy. i have split each link into a seperate swf file to speed up loading time, which is fine, however on the 'home' swf file, i begin with an animated preloader. i am looking for help on the home button on each separate swf file. what can i do to load the swf file at a specific frame label (rather than frame 1-which is the preloader)?
Preload External .swf And Play At Specific Frame
here is my problem for all you flash guru out there.
i have this main movie that has a background music loop, which i saved as a separated .swf file, that plays through all scenes in the main movie with out interruption. (user has the option to turn it on/off)
i have a preloader scene that only check, i guess the root level but not level 1 where i set the external .swf file. i am sure there's a way to check the completion of both level 0 and 1 of the movie before the it jumps to the very next scene, can someone tell me? also, i don't want the movie to load or music to play right after the .swf file is loaded. instead, i want it to play at a specific frame of the next scene. so is there a way i can "store" the loaded .swf file and play it when the movie process to the desired frame?
thanks in advance for your time!
Telling A Movie Clip To Play Until A Specific Frame
For instance, i have 5 buttons, so when you press the first button the movie clip should play from its first position to a second position and stop, then if you press the 2nd button, the mc should play from the second position til its third position and stop so on...
BASICALLY: im looking for continuous playing until the desired frame and then make it stop.
Tricky On Rollover Play And Stop On A Specific Frame Code?
Hello everybody,
I am wondering if I can assign a code to a button to go and play from frame"1" to frame "2" and then stop, but the trick is that I dont want to have a "stop" code on a last frame because I need to play whole movie through (looping) and only stop when I will rollover the button. The scenario is to play whole movie through in a looping and only when the user will rollover the button it will play a certain set of frames on a timeline and then stop.
Any advice is highly appreciated.
Thanks in advance.
[F8] Passing Variables From HTML Page To Actionacript To Play Specific Frame
Hi there,
I am a newbie to Flash actionscript and there is a particular thing which i am wanting to achieve.
I'm building a menu in flash which is to be placed on a HTML page. I'm wanting to pass variables from the HTML page to the movie and tell the movie to play a specific frame.
Now, i have managed to add a variable of page to a dynamic text box, which displays the page variable from the HTML. For example - when my page is default.asp?pagenum=1 my flash movie reads the variable and displays a number "1" in my movie. So, in essence, i have already passed the variable.
However, what i'm actually wanting to achieve is for the movie to go and play a particular frame according to the page number, not display it within the text.
Does anyone know how i can go about doing this?
Like i say, i am very much a newbie to actionscript, so i need things explaining very basic terms!
Many Thanks
[MX] On Release, Play Specific Amount Of Frames Then Return To Stopped Frame
So what I'm trying to do is create a button when clicked it will gotoAndPlay at a specific frame number, play for a # of frames, then return to the button once those frames have been played.
I've labeled the frames, so I'm sure I should use the label somehow, I understand how to get to the frame I want to start playing, just not sure if there's an actionscript to get back to the button once the labeled frames have played.
FLV Continuing To Play, Even When Not On The Timeline?
I have an FLV that is in a movieclip on frame 1 only. When I jump to frame 5 (where the movieclip that is holding the FLV is no longer there) the audio of the FLV is still playing in the background. If I jump back to frame 3 (where the FLV is STILL not there), THE AUDIO OF THE FLV PLAYS AGAIN!
What gives?!?
Code To Play A Mc Before Continuing The Timeline
Hey,
I need the code that will make a whole mc play before playing the rest of the timeline.
I had it somewhere but forgot it now...
I made most of my movie out of movie clips, and rather than spacing them out the right amount of frames so they all join together right, like I did at first, i'd rather do it the easy way.
Ian
Stopping A Movie Clip From Continuing To Play
Hi
Apologies if this has already been asked. I have two movie clips in my FLA. The main timeline consists of 250 frames with a stop action to end the movie on the last frame. I've noticed that my two MCs continue playing after the main movie has stopped and am looking for help in stopping these when the main movie stops.
I am using Flash CS3. Any help much appreciated.
George
Pausing A Frame, Then Continuing...
Flash5
this is probably easy peasy, but nevertheless.
Instead of adding frames to a scene to lengten a keyframe, can't you use an actionscript on a keyframe to 'pause' the flashanimation and then after some seconds (which you define) continue with the animation? And if yes, what is that actionscript?
Thanks!
Stopping A Movieclip On Rollover, But Letting The Movie Clips Inside Play
I have a movie clip that bounces back and forth on the stage, and I need it to stop on rollover. I can do this easily with an on rollover action. The problem is, inside of this movie clip I have more movieclips that need to have on rollover animations. The stop action does not let these movie clips play when the mouse rolls over. Here is an example .fla:
thank you in advance for your help
Example .Fla
Attach Code
on (rollover) {
stop();
}
Stopping A Movieclip On Rollover, But Letting The Movie Clips Inside Play
I have a movie clip that bounces back and forth on the stage, and I need it to stop on rollover. I can do this easily with an on rollover action. The problem is, inside of this movie clip I have more movieclips that need to have on rollover animations. The stop action does not let these movie clips play when the mouse rolls over. Here is an example .fla:
thank you in advance for your help
Example .Fla
Attach Code
on (rollover) {
stop();
}
Making Movie Play When Mouse Is Moved But Letting It Finsh When Stopped Moving....
Hmm I don't ask for much do I?
Basically what I have is a logo, that is writing with animated radio waves spewing out of it. The movie takes about 1 second to finish and its on a loop. I find this quite distracting as its on the site the whole time, so I thought it would be nice to have it only playing when the mouse is moved (anywhere on the screen), and have it stop when the mouse is at rest. However, when the mouse is stopped, it lets it finish the loop its on, so it looks nice.
I don't know much about Flash, so is it possible (and how!), and am more than willing to help with any PHP/MYSQL stuff in return. Cheers.
Trig One Movie To Play When Another Movie Enter Specific Frame?
[FLASH MX]
Very annoying problem. Why it is so I don’t know. Very short description of my problem:
What I want to do is to trig movie called “big” to start play when another movie that is playing on the stage is finished (or enter specific frame number).
1.Movie “little” enter (or cross) the frame 100
2.Movie “big” starts playing from label “port”
I don’t think that this is a big problem, but I can manage to put the right script. It said that “this script is only for button instances” or something like that.
Please help…
Regards,
STill
If Timeline Came From (specific Frame Of Any Scene), Go To (specific Frame)
Hi, I have thirteen scenes, each one has 2 frames, one with audio (loadSound) one without. What's the best way to tell flash when a user clicks on a nav button (which calls a scene) to go to the 1st or 2nd frame of the scene depending on if the previous scene was playing the 1st or 2nd frame?
Thanks in advance.
Play Specific Frame Of Movieclip From Other Movieclip
now this may look like simple stuff but it is not happening.
i ve made two movieclips 'menuball' which is animates the small ball inside the scene (like a bullet for menu item) and 'menumain' where 'menuball' is embedded and small text which is button.
now i want when this button in 'menumain' is pressed. the 'menuball' clip shud be played from 12th frame onwards. this will basically withfraw the ball from the scene.
i ve used simple code
on(release)
{menuball.gotoAndPlay(12);
}
or
this.menuball.gotoAndPlay(12);
or
_root.menumain.menuball.gotoAndPlay(12);
and many more like this
but none is working
i am attaching the small fla file. please help me in this. i am not getting any solution. and my whole work is stuck coz of this.
Specific Html Page Triggers Specific Frame Of The Flash Movie
I have been playing with flash and html and wonder if any of you have a bright idea on how to do this.
I have a flash movie, which I call from html but depending on which part of the html page I call it from I want to start it at a particular frame and not always from the beginning.
I have created a variable within the movie in action script and given it a different value for each of the frames I want to start the movie at, and want now to designate the value I give to that within html so that the movie “jumps” to the correct frame. Is this possible or am I totally crazy??
How To Load Specific Frame Of Specific Movie On Another Layer
Here's my setup:
Layer 0 = main movie
Layer 1 = navigation movie
Layer 2 = products.swf
Using a button located on Layer 1 (that contains navigation.swf), I need to load on Layer 2 the products.swf, and it needs to land on frame 54 of that movie.
I'm fairly illiterate r.e. ActionScript, so go gentle on me, please, LOL
Thanks!!!!!
Stop All Sounds = Play All Sounds
Ok, I'm pulling my hair out
I have 3 movies Layered togehter.
1- Sound file with someone speaking
2- Index moive that loads the Sound file
3- Sound On/Off button
On the Sound On/off moive I would like the button to stop all sounds and then continue playing the same sounds when clicked one again. (Basically pick up where the animation currenlty is.)
Attached is what I have been currently trying. I stops the sounds, but dose not continue to play when - click to start the sound again.
What gives GGGGRRRRRRRRRRRRRRRRRRRRRRRR!
Play Sounds After Stop All Sounds
Dear all,
I have a question which I hope someone can answer: my flash animation starts immediately when a visitor comes to the page. I have a stop button which stops the animation and the sound which comes with it (speaker voice). A play button plays the animation after the stop button was pressed. But the play button only plays the animation, not the speaker voice. How do I do this? I want the sound to start were it was stopped, just like the animation.
I'm using Flash mx 2004, version 7.2
Thanks in advance for your replies
/Bo from Sweden
Stopping Specific Sounds
I am at my wits end trying to figure out why when I click my off button to my music tracks, the narration also shuts off.. I originally had a stop all sounds on the off button, which would explain why it also stopped my narration, so I made the music tracks objects, and the narration STILL shuts off? These are two seperate flash files too? one is in the footer(music) and the narration is in the content area... Here is the action script I used to control each music track.. There is no mention anymore of stopping all sounds, yet it still shuts off my narration? I'm baffled on this one.. Any help would be appreciated.
Mike
Code:
here is the code for the keyframe..
mySound = new Sound();//create sound object
mySound.attachSound("soundFile");//attach file to object
mySound.start(0, 10000);//start the sound, 10000 loops
Here is the code for the actual on button,
on (release){
mySound.stop();//so sounds don't duplicate
mySound.start(0, 10000);//start the sound, 10000 loops
}
and here is the code for the off button
on (release){
mySound.stop();//so sounds don't duplicate
}
------------------------------------------------------------
Notice how I have no mention of stopAllSounds
?????
Using Buttons To Loop Specific Sounds
Ok I have been using flash 4, I recently got flash 5, and am having a hum dinger of a time getting used to the new code and interface. The question is
I want a couple of buttons to play ambience loops for my site.
I am not sure of the best way to do this. Should I try to set up some sort of script that will loop the sounds indefinitely till the user presses a button or the stop button.
If this is possible how do i accomplish this
Or should I set up the loops in different frames and have the buttons point to them.
OOOOOORRRRR should I try to use tell target and have the sounds in a MC (it seems they changed the tell target thing. So how do I do that)
Please help a confused flash head
much love
ded
Targeting Specific Sounds Out Of An Array
Hey Folks! I hope everyone is having a lovely time with their latest works. I haven't dealt with sound in flash much and encountered a snag I'm hoping someone could give me some insight on. I have an array of sounds I want to attach to my movie and need to control them independently of each other. Currently all my sounds play at once when I set the start(); method. I can't target a specific sound with something like: mcSnd.mcSoundHolder_1.start(); because its a movieclip not a sound object. So how do I target individual sound objects loaded into an array?
Here's my script:
fBepSoundEffects = function () {
var mcSoundLib:MovieClip = this.createEmptyMovieClip("mcSoundLib", 1);
var sfArray:Array= Array("bgBeat", "tvZoom", "warp");
for (var i:Number = 0; i<sfArray.length; i++) {
var mcSnd:MovieClip = mcSoundLib.createEmptyMovieClip("mcSoundHolder_"+i , i);
var sndRef:Sound = new Sound(mcSnd);
sndRef.attachSound(sfArray[i]);
sndRef.start();
}
};
I'm sure its something simple or I maybe I can't use sound objects like typical objects?
I appreciate any words of advice the more knowledgeable can provide. Thanks in advance!!
[F8] Playing Sounds In A User Specific Order
I've got an issue here, that I honestly can't figure out how to resolve. For class I have to make an interactive poem that the user can select any line of the poem at a time. How I was thinking of doing this was to have five movie clips each with the word "Line" and the number that it corrosponds with, and five place holders that you drag the line movie clips to. What I would like to do is have external sound files play in the order the user selects. Any ideas?
Fading Out The Specific Sound Without Effecting Other Sounds
Hi!
Is it possible to fade out only specific sound which is added by AS and not effecting other sounds which are added in timeline? My problem is, when the 1st sound gets faded (lowering the volume to 0), the other sounds that should play after 1st sound aren't hearable because setVolume is at 0.
One solution is to attach all sounds through AS on it's own MovieClip, but I'm wondering is there any other way?
Here's my code:
Code:
// Declaring variables
this.createEmptyMovieClip("soundHolder", 100);//this.getNextHighestDepth());
var sound:Sound = new Sound(soundHolder);
sound.attachSound("wind");
var fadeIntervalId:Number;
var volval:Number = 100;
//
// This is fading audio function
function fadeOut() {
clearInterval(fadeIntervalId);
var diff:Number = Math.round(volval/20);
//the step of decrease/increase
fadeIntervalId = setInterval(function () {
if (sound.getVolume()>0) {
sound.setVolume(sound.getVolume()-diff);
} else {
clearInterval(fadeIntervalId);
}
}, 10);
}
//
// This is preloader function
this.onEnterFrame = function() {
if (getBytesLoaded()<getBytesTotal()) {
sound.start();
} else if (getBytesLoaded() == getBytesTotal()) {
fadeOut();
delete this.onEnterFrame;
}
};
Thanks in advanced,
bye Mario :D
Tell Frame To Change If A Specific Frame Combination Is Loaded
To get a better idea of what Im talking about please check my flash page. http://www.munktiki.com/Munk-e.htm
You can see that when a different munk-e color is selected and you have his ear extentions on(bottom left in the piercings menu)that the colors dont match.
So.... when the color movie/orange frame is selected and the earring movie/ear extensions frame is selected then the orange frame will tell the earrings movie to go to the correct corrisponding color earring.
Man I hope this makes sense, it barely does to me.
Hope someone can help
Help Load A Movie (and Frame) On A Specific Frame In My Timeline
I need to Load a movie and go to a specific frame within that loaded movie.
I know how to do this "on press & release" commands but how do I get it to load when a certain frame is reached in my timeline.
Example. When finished preloading it plays frame 25. When it gets to frame 25 I wan't a movie to load and start on a certain frame.
If you need more info or I am not making myself clear, please let me know.
Thanks in advance.
Trig Movie "big" To Play When Movie "little" Enter Specific Frame?
Very annoying problem. Why it is so I don’t know. Very short description of my problem:
What I want to do is to trig movie called “big” to start play when another movie that is playing on the stage is finished (or enter specific frame number).
1.Movie “little” enter (or cross) the frame 100
2.Movie “big” starts playing from label “port”
I don’t think that this is a big problem, but I can manage to put the right script. It said that “this script is only for button instances” or something like that.
Please help…
Regards,
STill
Trying To Make Movie Play Frame X To Frame Y Then Switch To Frame Z..
Hello,
I was hoping someone could help me out with an issue I'm having. I have my flash on multiple scenes, and would like to play an animation when clicking on the navigation button before switching to a different scene.
I'm halfway to accomplishing this.
Here is what i used
Code:
_root.gotoAndPlay("changepage1");
_root.onEnterFrame=function(){
if(this._currentframe=="changepage2"){
gotoAndPlay("Home2",1);
}
}
The above code is on a blank keyframe. Changepage1 is the start of the animation and Changepage2 is the end of the animation.
Upon clicking the navigation button it plays the above scenes.
However it doesn't change scenes to scene "Home2".
Thank you in advance for all your replies.
Help: How To Go To Specific Frame Automatically When Hit A Certain Frame?
Im trying to make a project where i have a set of picture "destination" and when you click on a button on that picture, it takes you through a series of pictures that plays automatically, but when it finishes, I want it to go back to a different picture destination automatically that wouldn't be the frame right after the one that just played.
All I know is how to go to different frames with buttons with the onrealease gotoandstop/play stuff but don't know how to make them go to a frame when playing without the use of a button. please help!
'play' All Sounds
Hi is there a command like 'stopallsounds' except that plays all sounds? Or a command that will play sound again after you stop it. I need to be able to start a number of sounds playing again after they are stopped.
Thanks.
Can't Play Sounds
I don't know much flash code at all, and after 45 minutes of messing around, i still can't figure out how to make a button play an imported sound. so far i just have the on release part.
and while i'm asking, will this code work for a volume bar if a sound is playing?:
onClipEvent (load) {
//creates a new variable and sets it equal to the x position of the slider
xvol = Math.round(_parent.volumeslider._x);
//creates then sets the drag coordinates of the slider
left = _parent.volumeslider._x - 100;
top = 0;
right = _parent.volumeslider._x;
bottom = 0;
}
onClipEvent (enterFrame) {
//sets text field under slider equal to the xposition of the slider
_parent.voloutput = xvol;
xvol = Math.round(_parent.volumeslider._x);
//calls the method of the sound object created on the main timeline
//and passes it the variable of the slider's x position
_root.mySound.setVolume(xvol);
//makes sure that the variable of the slider will never go above 100
if (xvol>100) {
xvol = 100;
}
}
Sounds Sometimes Play Sometimes Not. - Help
hello,
main swf loads into _level1 another swf.
the loaded swf contains several sound effects.
button effect sounds.
and a onEnterFrame function that contains
conditional sounds events that should be played when an event is accured.
the problem is that sometimes the sounds play and sometimes not.
rollover sound of a button sometimes play sometimes not.
can someone help.
piny
Play Sounds After Each Other
I am working on a kind of musicgame. I have created a flashfilm where You can select different instruments ( linked musicfiles)and then play them. But now they play at the same time. I want them to be able to put some of them after each other ( like in a timeline ). So the player can make a little song/tune.
I have really know idea what codes to use. OnSoundComplete? Anyone who knows?
[F8] Play Sounds?
How do I play a sound that I imported? I did it by making a movie clip with the sound in it.... whats an easier way?
Can't Play More Than 3 Sounds...?
So I've got 2 layers of audio. One is background music...the other is for voice-overs. On the VO layer, I have keyframes throughout (about every 75 frames) where I've put a VO clip on each. The problem is that it only plays the background music and the FIRST TWO VO clips. I'd tried deleting the first 2 VO clips for curiousity's sake, and it ended up only playing the next 2 clips.
Any help would be greatly appreciated.
Thanks.
|