Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Stopping And Controling Sound On A Timeline


hey people,
i got a piece of sound on a seperate layer at the root of my movie.
The problem: When i stop the movie, the sound keeps playing, how do i stop it?
How do i control the volume of all the sound in the movie, not just the one on the layer?

Thanks
Metal Fusion




FlashKit > Flash Help > Flash ActionScript
Posted on: 06-11-2003, 07:30 AM


View Complete Forum Thread with Replies

Sponsored Links:

Controling Sound On A Different Timeline?
Right now in a movie that i'm creating, I have sound effects happening when you roll over a button. ie the sound is put on a layer inside the button to start on the rollover position. I have 4 buttons created that way.

I would like to have an option for the viewer to turn off all the sounds so when they rollover the button the action still occurs but not the sound.

I've tried so many things many things and nothing seems to be working.

I have a feeling since it is not in the main timline, I can not control them together. Is there some type of code that would inable me to cotrol the sounds from the main timeline???

I was kind of thinking that possibly a tell target in the button (so it's just a link to the sound and it's not actually in the buttons timeline) or somthing along those lines would work. However I'm not sure of the logistics exactly.

Any help would be greatly appreciated! Thanks so much.

View Replies !    View Related
Stopping Timeline's Sound But Continue The Video's Sound
Hi folks!

I need help to solve this problem. I can't seem to get it work out.

I have a music playing in Timeline (looping forever) when the flash site starts.
In some sections of the flash site, there is a video section where users can watch a video.

When the video is played, I would like to stop the sound in Timeline so it doesn't interfere with video's sound.

For loading the video, I am using Video Object, the code is simply:

var my_conn:NetConnection = new NetConnection();
my_conn.connect(null);
var my_stream:NetStream = new NetStream(my_conn);
my_video.attachVideo(my_stream);
my_stream.setBufferTime(3);

Many many thanks in advanced for your help!!

ps: I have tried following links, but no luck to me.
http://www.kirupa.com/forum/showthre...ht=sound+video
http://www.kirupa.com/forum/showthre...ht=sound+video
http://www.kirupa.com/forum/showthre...ht=sound+video

View Replies !    View Related
Stopping An Internal Timeline Sound
I have a movie clip on the main timeline that is basically a lip synched character with labels for various actions with audio.

The audio is embedded into the timeline.

When I start the movie, it starts playing the character movie clip

i.e character_MC.play();

However I have a help button on the main timeline that takes me to a label on the main timeline that plays an externally loaded sound. When I click this help button, it navigates to the help label and the help audio starts playing.

Problem is that the character continues to play whatever audio file it was currently playing.

Any idea if it is possible to stop this character audio playing when it is half way through playing?

I would prefer not to have to restructure the character movie clip as it is fairly complex lip synching. I tried just using character_MC.stop(); but this doesnt stop the audio.

Many thanks

View Replies !    View Related
Stopping Sound Started In Timeline From A Class
I made a Class that when I click a button it goes to the next frame. Unfortunately every frame has sound and I want the sound that began in the current frame to stop when the button is clicked to go to the next frame. The sound is already setup to advance the timeline one frame when it is done, but the user will be able to advance it a frame before the sound is over, so in that case I want the sound to be stopped when the button is clicked.

Here is the code for the class that controls the button:

Code:
package lesson
{
import flash.display.*;
import flash.events.*;

public class NextButton extends SimpleButton
{

public function NextButton()
{
this.addEventListener(MouseEvent.CLICK, oneFrameForward);
}

private function oneFrameForward(evt:MouseEvent):void
{
MovieClip(DisplayObjectContainer(root)).gotoAndPlay(MovieClip(DisplayObjectContainer(root)).currentFrame + 1);
}

}
}
Here is the code that is on the timeline that plays the sound (only part of the code, the part with the necessary variable info):

Code:
var teachURL:URLRequest = new URLRequest("micRec1.mp3");
var micTeach:Sound = new Sound();
micTeach.load(teachURL);
var channel1:SoundChannel = micTeach.play();

var mySoundTransform:SoundTransform = new SoundTransform();
mySoundTransform.volume = 1;

View Replies !    View Related
Controling The Timeline
Hi all

Im new to this actionscript 3 business and imtrying to have a go I have been playing about with some code and I have a set of buttons in my flash file and i have written some code to tell them to go to frame label in their own time line, so when you hover over the button gets bigger and then smaller.

this is the code for the buttons

--------------------------------------------------------------------------

readytab.addEventListener(MouseEvent.CLICK , readytabClick);

function readytabClick(event:MouseEvent):void
{
trace("youve pressed the button");
var spendURL:URLRequest = new URLRequest("http://www.igloo-design.org/testflash/arr_pages/ready_to_buy.html");
navigateToURL( spendURL , "_self");

}

readytab.addEventListener(MouseEvent.ROLL_OVER , readytabRollOver);

function readytabRollOver(event:MouseEvent):void
{
readytab.gotoAndPlay("front");


}
---------------------------------------------

if you look at the link below you will see that the flash file rotates several bits of information that relate to each button.

What I want to happen is when I hover over the button I also want the timeline to be directed to the relevant label in the main timeline

I tried copying what id already done and changing the frame labels but it didnt seem toi work

http://www.igloo-design.org/testflash/

View Replies !    View Related
Controling Timeline?
i have a project that has a video file imported in, the whole project is 100 frames and in frame 50 the video start to play, but i want to stop the timeline so the video plays and the resume playback on the timeline when the video stops? how do i go about doing this? any help would be appreciated. thanks.

View Replies !    View Related
Controling A Timeline With Flash
Hi,
ive been a graphics person for years but ive never really got into the coding side of things.
now i am doing im finding it increasingly hard to understand explanations of how to do things. So i thought i might ask for a bit of help.
heres what i want:
I have two frames, one the main window and one the control. All the control elements are embedded into layers, and using DHTML move around the frame.

I want to have a layer with a swf preloader on it appear in the control frame until the movie in the main window is loaded. Then the preloader slides off the screen and the menus appear.

How would i get flash to tell the timeline to advance?

Any help is greatly apreciated.

Cheers.

Tom.

View Replies !    View Related
Controling MC Timeline With Key Press
I'm trying to allow the user of the movie to move the timeline of a movie clip forward and backward when the left and right buttons are pressed.

This isn't exact but generally speaking here's what I have:

onClipEvent (enterFrame)
tellTarget movieClipName
gotoandStop (10)

//at this point I want the user to be able to make the timeline of the movieclip to go back and keep going back as long as the left key is down and then stop and stay on the last frame played when the key is no longer pressed.

if (keyDown (key.LEFT)
tellTarget movieclipName
(previousFrame)

Note: I could be going about this all the wrong way. If there is another way, a better way, or just a way that works, let me know. Thanks.

View Replies !    View Related
Controling Timeline Of MC With Loaded Swf
I have a question. How do I control a timeline of loaded swf.
It is loaded in another MC. And when i put button that says gotoAndPlay this and that it doesnt play it just puts it on frame that has a stop in it and that is it. I have some alpha effect in that loaded MC but it doesnt show. What is the problem, can i control timeline of this swf that is loaded in MC in this "main" SWF.
thanx

View Replies !    View Related
Controling The Timeline With _xmouse.....pls Help
Hi, I'm very new to advanced actionscript so be gentle
I posted in the Flash MX help forum but didn't get much help...then I figured this place would be better.

I guess most of you has visisted www.yulia-nau.de (down for the moment)
What I want to do is to create a similar effect to the one on the top with a movie where the frames are controled by the position of the x mouse but I have no idea of how to achieve this...

Please is there anyone that could point me to a good tutorial or any other resource, any help would be appreciated.

thanks

View Replies !    View Related
Controling The Timeline Of An External Swf..
- Is it possible?

If possible, I want to rewind the timeline of an external .swf when a button is clicked. And after it's been rewinded, I want to remove it from the "main.swf".
Getting my point?

-peace

View Replies !    View Related
Controling Main Timeline From External Swf
How is this done? I have loadmovie load up some movies and on exit I want the viewer to be taken to a named frame on the main timeline.......any suggestions would be greatly appreciated....

Thanks

View Replies !    View Related
Controling The Timeline From External Parameter
I have a simple flash menu. It has 4 sections, and each section has a sub section. It is on one timeline. Is there away to put a parameter in the HTML code, so it will say, load the Flash Menu, and then goto and stop at a certain frame? One timeline, no movie clips are involved. Is this done by putting a the parameter in the URL?

View Replies !    View Related
External Swf Controling Main Timeline. Possible?
Hello everyone, I have a problem I've been trying to figure out the past couple of nights and I'm getting no where.

I am bringing in an external swf a level above my "Main" timeline and allowing it to play after loading.

After reaching the end of this external swf's timeline, I want to advance to the next Frame Label on my Main time line, hence loading another swf.

Is it possible to control the Main timeline (_root) with an external movie?

I have created one main movie, containing actions layer (loading external swf), Frame Labels layer (with a stop action at the end of each) I also have a continue button on the Main timeline which will allow user to advance the timeline forward to the next Frame Lable and not have to wait for loaded swf to finish playing.

The external swf's timeline contains the following at the end of timeline:

_root.gotoAndPlay("WhyBuy");
stop();

Is this right? Can anybody shed some light?

Thanks,

Ramon

View Replies !    View Related
Controling A MC Timeline With Mouse Movement?
I want to make a large backround image that can pan left and right according to the movements of the mouse. If the mouse is on the right side of the stage the clip plays and the image appears to move right, and if the mouse is on the left side it moves left. You get the idea. I want this to be the navigation in a movie. The MC that I made for this project appears to loop so you think that it is continuous. (See attached file)

How can I control this MC so that if the mouse is on the left side of the stage the MC reverses and also loops in reverse like it does in forward motion.

Basiclly what it want to do is very similar to this...
http://www.hp.com/products1/promos/a...html?jumpPage=

Any help with this would be great.

View Replies !    View Related
[CS3] Controling Nested Movieclip From The Timeline
This seems like it should be so simple, but I'm still stuck. I want to tell a movieclip (about_mc) to gotoAndPlay it's second frame from the main timeline. about_mc is nested inside of map_mc.

This is what I have:

Code:
map_mc.about_mc.gotoAndPlay(2);
I'm getting this error when it tries to run that code:
TypeError: Error #1010: A term is undefined and has no properties.
at attempt8_fla::MainTimeline/startAnimation()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.transitions::Tween/set time()
at fl.transitions::Tween/nextFrame()
at fl.transitions::Tween/onEnterFrame()

If anyone can help I would really appreciate it! Thanks

View Replies !    View Related
Controling Timeline Forward And Backwards
Hello,
I would like to control the timeline with a sldier, or with buttons.
So I have the main timeline and an animation, I would like the animation not to play, but, instead, when I press and hold the Left Button for example, the timeline to play forward, and when I press and hold the Right Button, the timeline to play backwords. On both cases (left or right button), onRelease, the timeline should stop. Does anybody have a clue where I could find a tutorial like this? It would be great if there was a tutorial that explains how to implement a slider, so the user can drag the animation to the wanted frame.
Please give me a link to a tutorial .
THANK YOU

View Replies !    View Related
Controling Timeline Of External Swf Before Loading New Swf Into Same Mc
Hello,

I am trying to load external swf files into a mc on the stage however I would like to have the swf currently loaded go to frame 20 (of itself) and play to the end of the movie (frame 40) before the next swf loads...The next swf being what the user clicks from the menu and both are being loaded into the same mc called "myMovies"


I can load the swf files no problem what I can't seem to figure out is how to have a transition effect(playing frames 20-40 of the currently loaded swf before new swf gets loaded). Though I think it has something to do with levels/scope - because it is being called from an external movie.

This is the code from my main movie (which has a menu which loads external swf's into a mc on the stage called myMovies.


Code:

active = 1;
function loadNext() {
myMovies.loadMovie("clip"+active+".swf");
}
MovieClip.prototype.isButton = function() {
var num:Number = Number(this._name.substr(-1, 1));
this.onPress = function() {
if (_root.myMovies._currentframe == 20) {
_root.myMovies.play();
}
_root.active = num;
};
};


b4.isButton();
b5.isButton();


b4.onRollOver = over;
b4.onRollOut = out;
b4.buttText.buttonText.text = "IMMIGRATION CATEGORIES";
b4.onPress = function()
{
loadMovie("clip2.swf", "myMovies");
}

b5.onRollOver = over;
b5.onRollOut = out;
b5.buttText.buttonText.text = "ASSSESSMENT TOOLS";
b5.onPress = function()
{
loadMovie("clip1.swf", "myMovies");
}




function over() {
this.gotoAndPlay(2);
}

function out() {
this.gotoAndPlay(7);
}
The swf files which are being loaded consist of 40 frames. the first 20 being an animtion of a rectangle sliding into the middle of stage, and from frames 20-40 its the rectangle sliding out of view. All of the swf which I want to load have the same animation.

this is my code for the first 20 frames


Code:

import com.mosesSupposes.fuse.*;

ZigoEngine.register(Fuse,PennerEasing,FuseItem);


ZigoEngine.doTween(darkbg, '_width,_height, _alpha', [400,780,100], 2, "easeOutExpo");
ZigoEngine.doTween(gray, '_width, _alpha', [400.5,100], 3, "easeOutExpo");

function afterFuse():Void
{
trace("Fuse complete");
}
frames 20-40 have the following


Code:

import com.mosesSupposes.fuse.*;

ZigoEngine.register(Fuse,PennerEasing,FuseItem);



ZigoEngine.doTween(gray, '_width, _alpha', [1.5,0], 1, "easeOutExpo");
ZigoEngine.doTween(darkbg, '_width,_height, _alpha', [400,1,0], 5, "easeOutExpo");

function afterFuse():Void
{
trace("Fuse complete");
}

and finally on the last frame I have
Code:

_root.loadNext(this);
I hope someone out there can help, I have attached my files

Thanks.

View Replies !    View Related
Controling Movie Clips Timeline
I have a movie clip of a meter that movies when a song is being playing. I have a timeline in this movieclip with frame 1 showing movement, and frame 5 showing just a static image.

How do I interact with it from the main timeline? What I tried was meter_mc.gotoAndStop(5);

This didn't seem to do it though.

View Replies !    View Related
Controling Main Timeline From External .swf.
i've started a thread within general posts...i wondered if anyone else here can help....i've been on this for two days now trying to sort it..

i'm trying to control the main movie timeline with an external swf. i.e. u press a button....song starts...song title comes up via frame20/60/90 etc...but the swfs are streamed and when one ends the next starts....when the next starts the title doesn't change...coz it ha no trigger...anyone help ?



see this thread for more info


other thread.....
http://www.actionscript.org/forums/s...d.php3?t=46023

View Replies !    View Related
Controling A Timeline From A Drag Object
How can I control a MC timeline (forward and backwards) from a drag function on a seperate MC?

i.e as the user pulls the drag object on MC1 the timeline on MC2 moves on in relation to the amount the drag MC1 has moved, and reverse the MC2 timeline as the drag MC1 is pushed back.

View Replies !    View Related
Bizzare Controling Timeline Issue
I have this weird problem with controling the timeline.
I have a mc that plays and when it reaches the end of the timeline, this mc tells the root timeline to jump to frame 65. But it won't work.

my code looks like this: _root.gotoAndStop(65);

The weird thing is that it was working fine until i added another scene. If a drag this scene to the buttom of the stack, everything works again. I use the test movie instead of the test scene which usually does the trick but not this time.

It is annoying to spend this much time on something that was working. I don't see the logic.

any ideas out there?

View Replies !    View Related
Controling Timeline Via Mouse X Position ?
Hi i want to know if anyone can tell me how to controll the timeline via moving the moiuse in x (left to right ).
basicly i wsant to shocase a sculpture of mine in a seemingly quicktime vr fasion. so i will take lots of images of the sculpture in difrent agles to get the 360 degreemovie. then import intoflash timeline. Then somehow i need a script to control the scrub the timeline images (to create the quicktime vr look )

please help my project has to be in soon ..

Louis

View Replies !    View Related
Bizzare Controling Timeline Issue
I have this weird problem with controling the timeline.
I have a mc that plays and when it reaches the end of the timeline, this mc tells the root timeline to jump to frame 65. But it won't work.

my code looks like this: _root.gotoAndStop(65);

The weird thing is that it was working fine until i added another scene. If a drag this scene to the buttom of the stack, everything works again. I use the test movie instead of the test scene which usually does the trick but not this time.

It is annoying to spend this much time on something that was working. I don't see the logic.

any ideas out there?

View Replies !    View Related
Controling Timeline Via Mouse X Position ?
Hi i want to know if anyone can tell me how to controll the timeline via moving the moiuse in x (left to right ).
basicly i wsant to shocase a sculpture of mine in a seemingly quicktime vr fasion. so i will take lots of images of the sculpture in difrent agles to get the 360 degreemovie. then import intoflash timeline. Then somehow i need a script to control the scrub the timeline images (to create the quicktime vr look )

please help my project has to be in soon ..

Louis

View Replies !    View Related
Problem: [sound].setVolume(x) Controling Two Sound Objects In One Call...?
Hi there, hopefully some or at least one of you will be able to figure this out because it's wrecking my head!

Basically I'm writing a little looper player movie, that will play [x] number of techno/jungle/house/whatever music loops at the same time, and the user will be able to switch loops and turn loops on and off whenever they want to. I'd like to avoid putting sound in the timeline so I'm using sound objects to trigger the sound properties.

For a test, I've created two sound objects (these will later be in a 2D array), but for now- just two sound objects, I've attached the sound to the links in the library, and set the volumes on both sounds to 0. Both WAVs in the library have the linkage on "Export this symbol" and they are labelled/identified as "loop1_link", and "loop2_link"... (obviously without the quotes in the properties box). Here's the code:

// ---------------------------
loop_test1 = new Sound();
loop_test2 = new Sound();

loop_test1.attachSound("loop1_link");
loop_test2.attachSound("loop2_link");

loop_test1.setVolume(0);
loop_test2.setVolume(0);

loop_test1.start(0,999);
loop_test2.start(0,999);
// ---------------------------

So the sounds are triggered when the movie loads, and the start playing silently in the background for 999 loops.

Here's the problem:

In the interface of the movie, on click of a play button, I'm making a call to _root.loop_test1.setVolume(100) to turn that sound on, but when I make that call, the volume is set to 100 for BOTH loop_test1 AND loop_test2 !! I'm hearing both loops playing at the same time and I only want to hear just the one. Makes no sense to me because I'm only telling that ONE sound object to set it's volume to 100...

Any ideas? Any feedback/comments would be greatly appreciated.

Cheers,
Anthony
-Dublin, IE

View Replies !    View Related
Controling A Main Timeline From A Movie Clip
I am simply trying to tell my main timeline to go to another scene from a movie clip. I have used:

tellTarget (_parent) {
gotoAndPlay ("scene2", 1);
}

but it just won't work. I can control the current scene using this script but not change scenes.

Any idea what the problem is?

View Replies !    View Related
Controling The Timeline In A Loaded Swf. Movie File.
I need some help with some script.

In my main timeline I've got a frame action with this script in it:

stop();
loadMovie("custome.swf,here);
(I have a movie clip on the stage with an instance name of "here" that i load all the swf. files into.)

In my main timeline my navigation contains a button with this script:

//this tells the timeline to go to frame "custome" wich has the loadMovie action in it. It also tells the movie "custome.swf" to go to frame "test" and stop.(but that's not how it ends up working)

on(release){
_root.gotoAndStop("custome");
_root.here.gotoAndStop("test");
}

The first time i click on the button it loads the movie just fine, but does not got to the frame inside the movie i want it to. Unless i click on the button a second time. So it seems to only work when the movie is loaded.

I'm trying to get the movie to load and go to a frame inside the movie at the same time. Is this possible? Does any of this make sense?

If anyone can help It would be greatly appreciated.

View Replies !    View Related
Controling The Timeline Inside The Movie Clip
Need help!
I have a movie clip and I want to control the timeline. For instance if I push the "<LEFT>" button, then the frame should go from the first(which is stopped) to the second(stopped too)frame. Give me advice.
Thanks,
Sorry for my English.
Kris

View Replies !    View Related
Controling Volume Of Timeline Streamed Audio
I have audio that is streamed into the main timeline of a movie clip. I'm trying to control the volume with a slider but having some problems with it. I can control the volume of audio that I attach from my library. But this one needs to have the audio streamed into the timeline because it is synched to some other animations.

How can I control the volume like this? I have no way of giving an instance name to the audio because it's on the timline where I need it to be?

Thanks for any help with this!

View Replies !    View Related
Controling A Parent Timeline From A Loaded Movie
Hi Guys,

I've got a movie that is loading a random swf into a clip.
Each random swf contains a different photograph which pans and then fades out.

What I need to do goto the first frame in the parent timeline and start the whole process again.

My questions are:

A) How do I reference the parent timeline, I've tried:
_parent.gotoAndPlay(1);
but it doesn't seem to work.

B) What's the best way to unload the movie once it's run it's course bearing in mind it uses the following random code to load it:
url = "image" + Math.round(Math.random()*1) + ".swf";
loadMovieNum (url, 1);

thanks in advance
--Neil

View Replies !    View Related
External Text W/ Hyperlinks, Controling Timeline
I am loading external text as HTML in my movie and appling CSS to style the text. In the HTML i am loading i have hyperlinks. My questions is, can i apply actions to these hyperlinks? For example, , I want to control the main timeline with gotoAndPlay action when a hyperlink is clicked.

Can this be done?

I am using MX 2004 PRO. Hit me back, Thanks

View Replies !    View Related
[F8] Stopping Timeline Exactly Where It Is
I need help with stopping the timeline and audio exactly where it is when my pause button is pressed. The pause changes to a play button which on release I want to pick up from exactly where it is on the timeline and in the audio. Can this be done?? I'm fairly good with general scripting, but I didn't know if this could be done or if it was something really advanced. If anyone could help me I would greatly appreciate it. Thanks for you time and guidance.

View Replies !    View Related
Stopping The Timeline
ok, so I have what should be a simple problem, but I seem to be having trouble with it.

I need to stop the timeline on the first frame. Here's the code I'm trying to do it with:


Code:
stage.addEventListener(Event.ENTER_FRAME, stopStage);

function stopStage(evt:Event):void {
stage.stop();
}
When I run this I get this error:

1061: Call to a possibly undefined method stop through a reference with static type flash.display:Stage.

View Replies !    View Related
Stopping Timeline
Hi there,

Im totally new to flash but I want to try to make a small personal site with it.

The trouble Im having is knowing how to stop flash from looping and reloading my page when it gets to the end of the timeline.

Thanks in advance!

View Replies !    View Related
Stopping Timeline
Hi there,

Im a total newb with flash but I want to make a small personal site with it.

The trouble im having is that I want to make text move across the screen then stop and act as a button.
I can do this but what I want to know is how to make it stay until the user clicks to another page.

Right now, the timeline goes to the end and then redraws the whole page again. How do I get flash to stop the timeline when all my flash has appeared and is waiting to be clicked?

Thanks!

View Replies !    View Related
Stopping Mc From Timeline?
I am having a nagging problem of not being able to get a mc to stop.
I have tried
_root.mcBreif.mcHead.stop();
and this.mcHead.stop();

The mcHead instance is a mc of a guy talking and I want to just tell it to stop when it gets to points and play at other points of the mcBreif timeline.

Easy... done it dozens of time.... it just won't work...

Could it be the because I am working with scenes? I havn't done the scene thing much before.

View Replies !    View Related
Stopping And Starting Timeline
When I put a stop() in frame 1, I can't get the timeline to start back with goToAndPlay(2), play(), or continue. Is it possible to start and stop the timeline?

View Replies !    View Related
Stopping A M/c From Main Timeline?
Hi,

Is there a way to stop a movieclip playing using actionscript on the main timeline?

Thanks,

Ritchie

View Replies !    View Related
Stopping An Mc While Reversing The Timeline
The code below i use to reverse the timeline, but once it executes I cant seem to find a way to stop it at a certain frame/s

If I put stop actions intermittently on the root MC it ignores them.
ie. it rewinds to frame 1.

So how can i add to this code to to tell flash to stop if at certain frameS....

Please, any advice is golden..
thanks
Ant



mcReverse.onRelease = function():Void {
//enter the movie whose timeline u wish to reverse and the frame u want to rewind until
reverse(_root, 1);
};


function reverse(movie:MovieClip, frameno:Number):Void {
movie.stop();
movie.onEnterFrame = function():Void {
movie.prevFrame();
if (movie._currentframe == frameno) {
delete movie.onEnterFrame;
}
};
}

View Replies !    View Related
Problem With Stopping Timeline
im sorry, ive posted this topic on wrong place, but here it comes the right way. im trying to stop interval, but dunno how:-(

Im really out of any ideas, so here comes my problem, any idea for solving is welcome.

I have a little slideshow within a movieclip on my stage, using AS2.0 to pause timeline for few seconds(also in the same mc like slideshow):

function paused(sec) {
stop();// action to pause
var i = sec-1;//countdown
var t = setInterval(function () {
if (i == 0) {
clearInterval(t);
play();// action to continue
}
i--;
}, 1000);//milisecond multiplayer
}

calling it on every needed frame of mc by "paused (number of seconds i want)"

It goes well, unless i click on any of buttons on the main stage, switching to the next frame of the main timeline. After clicking on it, it goes on the next frame(frame02 for example) of main timeline, but than it seems(for me), that function paused is still continues and after running out of "(number of seconds i want)" it jumps on the next frame(frame 03) of main timeline and stops there.

I tried different methods to pause the timeline but its the same or even worse (it doesnt stop on "next next frame" at all and looping or using setTimeout does same )

I thought about specifying more this
if (i == 0) {
clearInterval(t);
because it says that the interval is cleared only when "i" reaches "0" so when i click the button before it reaches it, it has to go to the and and than play. But have no idea how to clear it when i click anything, cause in the "next frame"s actions clearInterval(t); doesnt work:-(

searched through many forums and many walkthoughs but didnt find the same or similar problem:-( Does anyone has any idea how to make it work fine?

here are my files:
http://www.volny.cz/studiook/101207.swf
http://www.volny.cz/studiook/101207.fla

fla (1616 kB)
swf (169 kB)


Working on it for 2 weeks and have no idea how to make it work:-(

sorry for second posting, but i think it should be here, so if you can, delete my first threat in General Help

View Replies !    View Related
Stopping All Sounds On A Timeline?
Is it possible to stop all sounds that are currently playing in a movie and at the same time stop future sounds that the playhead will encounter on the timeline?

Here is the code I'm using on the 'mute' button now:

ActionScript Code:
mute_mc.onPress = function() {    this._visible = false;    stopAllSounds();    //fadeout();};

View Replies !    View Related
.stop() For Sound Object Stopping Embedded Video Sound
I have a problem where the stop funtion for a sound object is stopping the audio in an embedded video. Has anyone ever encountered this? Ihave poured over my code and there is no cross-linked intance names, so I do not have a clue what is happening.

View Replies !    View Related
Controling Sound
i have created a stop and play buton which is controling a audio loop on my current website. But how do i get the sound to loop automatically without the user having to press the play button for it to play. whilst still having the option to stop it.
thanks to all
tony

View Replies !    View Related
Controling Sound
Help!
My little problem is I have a video clip in my scene and I also have music looping in the background through out the whole site. What I did is made an on and off button for my music, but what it is doing is... turning off the audio for my video clip as well. What is the best way to resolve this situation.

View Replies !    View Related
Controling Sound
How can I increase/decrease a sound or play/stop a sound. I have created a .swf file which has music and I loaded the music using the following command:

====================
stop();
this.createEmptyMovieClip("holderMC",1);
holderMC.loadMovie("http://www.xponseinc.com/dev/test/music.swf");
this.onEnterFrame = function() {
_root.percent = (holderMC.getBytesLoaded()/holderMC.getBytesTotal())*100;
if(_root.percent==100){
gotoAndPlay(2);
}
}
====================

This is working fine but I want also to control the sound. Is there any way??

View Replies !    View Related
Controling Sound
Ok, I am thinking that this is something so simple and that I am not able to piece the logic together because my brain is dead.

Here is my Issue:

I am making a very simple Flash game using Flash vs. 8.

When you click on one button it takes you to the intro screen, then to the character selection screen, to intro level one, then to level one and so on.

Anyhow, I have a different song or (sound loop/FX) for each seperate section.

Whats happening is that I tried to attach the song to the movie clip by going inside the movie clip and looping the sound from there so that it will continue playing while the user is on that screen.

What I have run into is that as soon as I click to a different section the song from the previous section is still playing. So I tried every section from Event to Start, to Stream to try and over come this issue and none of it worked.

So now I am thinking I need some Actionscript to control when the music starts and stops. I do not know how to code this.

Can anyone help?

I tried looking in Chapter 16 of Flash 8 Actionscript but all it talks about is attaching sound to movie clips but not to the actual scene. Is there a way to control the sound from the file? to start and stop when I need it to like when the user clicks and it moves to whatever keyframe, then stop and play this?

Any and all help would be great. If you need some clarrification please let me know.. Thanks!

View Replies !    View Related
Controling Sound
Hi. I am learning Flash, and I have a question regarding to controling sound.


ActionScript Code:
mySound = new Sound();
mySound.attachSound("sound.wav");
mySound.start(0, 1);

sq._x = 0;

function move() {
    this._x += 10;
    if (this._x > 500) {
        this._x = 500;
    }
}

sq.onEnterFrame = move;


With these scripts, the Movie Clip named 'sq' moves right from 0 to 500. Also the sound named 'sound.wav' plays when the Movie Clip starts moving.

But I would like to make the sound play when the moving object passed by, let say, 250. I have tired to do that with my poor ActionScript knowledge, yet it never worked. I am appreciated if some of you guys could help me out. Thanks. Have a nice day! Bye.


Karatechop

View Replies !    View Related
Stopping Playhead 3 Frames From End Of MC Timeline
I'm controlling a movie's timeline that I loaded in to a Movie Container by using a button action. I'm moving the playhead forward 3 frames at a time on Release.

I'm using this button action to move the playhead ahead 3 frames at a time:

on(Release){
x = _currentframe;
x = x+3;
gotoAndStop (x);
}

What I'm really doing is targeting a movie that is loaded in to a Movie Container which is called "whitebox". I'm moving that loaded movie ahead 3 frames at a time with this button action:

on(Release){
x = whitebox._currentframe;
x = x+3;
whitebox.gotoAndStop (x);
}

This all works just fine and dandly until I come to the end of my targeted movie's timeline. I want the playhead to stop on the 3rd frame from the end of the timeline. I don't want to see the last 2 frames. Is there some way to add a action that detects when I'm 3frames from the end and stops the playback. (hold on.. read the next part)

Here is the tricky part... I have to do this without adding any action scripts directly in my LoadMovie movie. It's ok for my Buttons, Movie Containers to have actions, but the movie I'm loading into the movie container can't be touched (cause it's loading in as a "swf" file for another source outside of flash).

Ok, where should I start. It's something simple..Right?

Thanks for your replys,
Cosmo

View Replies !    View Related
Stopping Timeline Without Stop Action
Hi there,

What im trying to do is find a way to stop the timeline of a movie clip at any frame that i specify in a piece of actionscript, without using the stop action. I want the movie clip to be able to play through all of its frames and then start from the start again (if need be) until it reaches a specific frame, (which will be different each time a different button is pressed).

What I have is a movie clip of a strip of images. At any time i want the user to be able to click one of those images and that will trigger the move clip to play and then pause when that image reaches the center of the screen (the movie clip generally just holds the strip of images moving from left to right and looping). then, if they click another image the movie clip will continue to play until THAT image reaches the center.

Any ideas? I guess to sum it up a piece of script that says "on click play until frame 'n' and stop" would be good. Don't know if this exists!!

Thanks,

Lara.

View Replies !    View Related
Stopping All Sounds On Main Timeline.
for some reason just putting:

on (release) {
stopAllSounds ();
}

in the actionscript of a button on my main timeline isn't working.
also, i'd like to have another button that turns all sounds back on.

what am i doing wrong?

thanks.

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved