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








Button - Stop The Currently Playing Mc...


Hi,

I have a complex timeline with many different MCs playing, telling each other to play when they end, and advance on the main time etc etc.

I have a global stop (and play) button. Is there a way to make this button "smart" as in
code:
on(release){
// look for the value of _root.CurrentlyPlayingMC and stop it
_root.CurrentlyPlayingMC.stop();
}

How do I set the value of 'CurrentlyPlayingMC' to the currently playing MC?

I tried adding a _root.CurrentlyPlayingMC = "introduction"; at the beginning of the MC (changing the variable value for each MC) but the button didn't do anything.

I so close to this project I am forgetting my AS. Maybe someone with less on their plate can help me out

Thanks,

/Flip




FlashKit > Flash Help > Flash ActionScript
Posted on: 10-04-2004, 06:03 PM


View Complete Forum Thread with Replies

Sponsored Links:

Button Won't Stop Playing
Hello I'm new here and i figured some of you smart people out there may be able to help me or at least guide me in the right direction.
My problem is that i have a button which in the over state has a movie clip on it. I also put an action on it so when you rollover it it plays a motion tween. Everything works great except if you hold the mouse over the button it will continue to play the same movie and tween over and over again. I put a stop in every place i could think of and it just won't work. any tips would be greatly appreciated.
Thanks

View Replies !    View Related
How To Stop Movie Clip From Playing In Button?
Pls refer to the link below:

http://www.tsldesigns.com/test/dynamicbutton.html


Hello, pls help. Just Click Refresh and you will see the Movie Clip animates even without mouse over. How do I stop this?
Where should i put the stop() action? You can email suggestions to sulin@tsldesigns.com Thanks.
Or I can also send you the fla to check. Basically I created 2 Movie Clips in Flash, with opposite animation - Menu In and Out. In the Up Button state, I put Menu In Movie Clip and in the Over Button State, I put Menu Out Movie Clip. I put stop() actions at the last frame of both MCs.
Now, where should I put the stop() action to stop the Menu In MC from playing on loading Flash movie?

Hope to get reply soon. Thank you.

best regards,
Su Lin

View Replies !    View Related
Stop/pause All Playing Movies With One Button Click.
Stop/pause all playing movies with one button click. I want to stop all the movies playing in one movie with a press of a single button. Is there a function or code, which i can call from a button which stops all the movies playing and i do not have to give the path of each movie individually.
Thanks,
Ram

View Replies !    View Related
How Do I Enable A Playing Movie To Slow Down And Stop At The Click Of A Button?
Hi,

I was just wondering whether someone could tell me how to script a playing movie (within a movie (not on the main timeline)) to slow down and eventually stop.

For example, I click on a button (that's not on the timeline) and I want a certain movie that's already playing to slow down over a period of 10 frames and to stop on the 10th frame.

Any ideas? Anybody?

Thanks for your help!

Blastbum

View Replies !    View Related
[MX04] How To Stop Video From Playing Automatically Until User Click A Play Button?
I am using Flash MX 2004.

I have made a video player from scratch and not from the pre-baked components.

I have the video player with a play/pause button, rewind button, a loader, buffer, mute button, etc.
The flv. Videos load into a list box via an xml file which then the user can click the desired video link and switch from video to video.

Using action script I want to know how to stop the video from automatically playing until the user clicks a play button when the player first opens.


var nc:NetConnection = new NetConnection();

nc.connect (null);

var ns:NetStream = new NetStream(nc);

theVideo.attachVideo(ns)




rewindButton.onRelease = function()
{
ns.seek(0);
}

playButton.onRelease = function()
{
ns.pause();
}

View Replies !    View Related
Making A Stop Button, Or Telling A Button To Stop A Streaming Video
Hello,

I've searched the forums and tried to find an answer to this question, but most of the posts go unanswered or are way beyond my understanding.

I'm using a form based application in Flash professional 8.

I have a .flv video of a movie trailer that I created from Quicktime. I intend to stream this video.

I also have a button called "Trailer". When I click on the "Trailer" button, I see the .flv video I created along with the play/pause control skin that I added in the import video wizard. I press the play/pause button, and the movie plays.

This is as I had expected it to be.

Now, when I want to go to something different, for example clicking a "Photos" button that displays a slideshow, the video continues to play.

Is there a way I can tell the "Photos" button to stop the streaming video?

I've searched the forums, and found a few answers, but I don't really understand them. I added them to the script of the "Photos" button anyways to see if they did anything, and every time the video still kept playing.

Here's what I've tried so far:
------------------------------------------
button.onPress = function (){
player_mc.clearVideo();
}

Where player_mc is the instance name.
-------------------------------------------
Adding a stop component, but this isn't really what I want. I'd like the "Photos" button to stop the movie without the user having to hit a separate stop button.
-------------------------------------------
.stop() and ._visible=false;

I don't really understand this.
-------------------------------------------
removeMovieClip("component_mc");
-------------------------------------------
instance.stop()

From what I understand this is only for adding to a keyframe to stop a movie that's looping, and not for what I would like to do. Is that correct?
-------------------------------------------

I would greatly appreciate any help, not only just for me, but for any other newbie who may run into this problem.

Thanks!

View Replies !    View Related
Stop Playing
Hi,

What code can I used to tell a mc to stop playing once the button is clicked. My problem is that the mc is still playing once the button is pressed...I need to have it stop on command.

Thanks for your help!

View Replies !    View Related
Swf Won't Stop Playing
Hello I have an external movie that I am player in another swf.
I would like to stop the swf when its sequence finishes but it just seems to stick around and not finish. I.e when the movie is done it dosn't dissapear in the other movie clip. I know this should work because my other swfs work fine. The difference with this one is that it has a control bar inside it that is used to rewind, fast forward, ect.

I am not sure how to unload this clip inside the file itself. I cannot change the script in the main swf though this needs be done from the external file (the one with the control bar that is being loaded into the main movie).

Here is the script from the external swf with the control bar that is being loaded in. Any ideas?
Frame Actions:

_parent.stop();
faderbackground._width = width;
looping = false;
playing = false;
top = knob._y;
bottom = knob._y;
left = knob._x;
faderWidth = faderbackground._width-knob._width;
segmentWidth = faderWidth/_parent._totalframes;
right = knob._x+faderWidth-segmentWidth+1;
faderbackground._width -= (segmentWidth-1);
with (backing) {
_width = Math.abs(_x)+faderbackground._width+((_height-faderbackground._height)/2);
shadow._width = _width;
}
_parent.onEnterFrame = function() {
if (_parent._currentframe == _parent._totalframes && !looping) {
playing = false;
_parent.stop();
}
if (dragging) {
playing = false;
_parent.gotoAndStop(Math.ceil(knob._x/segmentWidth));
} else {
knob._x = (_parent._currentframe*segmentWidth)-segmentWidth;
}
//
playhilite._visible = playing;
loophilite._visible = looping;
//
};
//
// playback controls
loop.onRelease = function() {
loophilite._alpha = 100;
};
loop.onPress = function() {
looping = !looping;
loophilite._alpha = 0;
};
playButton.onPress = function() {
playhilite._alpha = 0;
};
playButton.onRelease = function() {
playhilite._alpha = 100;
playing = true;
_parent.play();
};
playButton.onDragOut = function() {
playhilite._alpha = 100;
};
playButton.onDragOver = function() {
playhilite._alpha = 0;
};
stopButton.onRelease = function() {
playing = false;
_parent.stop();
};
rewind.onRelease = function() {
playing = false;
_parent.gotoAndStop(1);
};
stepBack.onRelease = function() {
playing = false;
_parent.prevFrame();
};
stepForward.onRelease = function() {
playing = false;
_parent.nextFrame();
};
goToEnd.onRelease = function() {
playing = false;
_parent.gotoAndStop(_parent._totalframes);
};
knob.onPress = function() {
_parent.stop();
startDrag(knob, false, left, top, right, bottom);
dragging = true;
};
knob.onRelease = function() {
stopDrag();
dragging = false;
};

View Replies !    View Related
Please STOP Playing
It just keeps on looping.
I even tried an action script in the last frame.
Please help me make it stop. I was hoping something in properties or export values, but cant locate it.

Newbie here...I apologize.

~W

View Replies !    View Related
Long MP3 Won't Stop Playing
Hi, forum. First of all, bless all of you old salts who make a bee-line to the Newbies threads to read the likes of this. You're the class I should be taking at the local BOCES, but for lack of $.

Anyway, today I placed a 4-minute-long piece of music, an MP3 with top resolution (iTunes), onto a layer, to read the track onto an exposure-sheet. (Anyone remember those?) The song shows up as a single frame. I hit the Play button on the control panel, and the music plays. I hit anything else, or attempt to scratch with the red frame marker, and nothing happens. It keeps going till the end, or till I quit Flash.

My equipment: iMac, 256mb, Flash 5. My education: the manual.

Rick Wolff

View Replies !    View Related
How Can I Stop Sound From Playing
I got a simple question - I bet you have a simpler answer

What I want..
-------------------
Make an animated gif of a flag move when u have the mouse over the button(gif)and at the same time play the national anthem until you remove the mouse away from the button - then the music and animation should stop.

What I have done..
-------------------
a)Made a MC (flag_move) and imported the animated flag.gif to the MC. Also imported the anthem.mp3 file. Added a new layer and at the first frame on that layer I put the mp3 with sync:start

b)Created a button (flag_butt). At the "UP"-state I hade a gif of the flag not moving. On the "OVER"-state I placed my MC (flag_move). "DOWN"- and "HIT"-state I left alone.

c)Placed an Instance of the button on the stage

What happens..
-------------------
When I move the cursor over the flag it starts to animate it and the anthem plays just like I want - BUT - when I remove the cursor from the button-instance the music continues until the mp3 is done. NOW What/How should I do to get the music to stop at the same time my marker leaves the buttonarea ????? ??

View Replies !    View Related
Stop MC Playing Again In Scene 2
Hi

I need assitance figuring this out.

I have a Flash MX movie that contains a movie clip.

In scene 1 the movieclip plays.

When It finishes, it goes to scene 2 and stops.

However because the animation has been put into a movie clip, in scene 2 the animation plays again.

How can I make the movieclip in scene 2 goto its last frame?

One answer is not to use scenes which I would prefer not to do.

Thanks

View Replies !    View Related
Stop And Clear MC From Playing
I have an MC called MCShip.

I want to assign a button an Action Script ... that onPress, the MCShip movie clip will stop playing and clear itself from the screen.

How do I type that Action Script?

View Replies !    View Related
Playing To Last Frame, Then Stop..
Well as the title says, when i push a button, i want a movieclip to play to the end of its timeline and then stop. (its constantly looping now). I would guess that and action saying gotoendAndStop(u get the idea) or something like that would be what i need.

Remember i cant just use stop in the timeline cause of the loop. Or maybe if i could activate a stop function when i hit a button?

Thanks in advance...

-Bad fish

View Replies !    View Related
How Do I Stop A Movie From Playing Over And Over
When I put a file on my webpage it just kept playing over and over. Like a loop. How do i get my movie to play just once?

Thanks,
Senna

View Replies !    View Related
How Do I Stop Playing The Music
I put some music into my file and when i play, it won't stop. Also, can i splice the music to play different segements?

View Replies !    View Related
Song Stop Playing
How to make the song stop playing when going to next scene?
any scripting ?

View Replies !    View Related
Stop Sound Playing Over The Top Of Itself
Okay, i really need some help on this. I have a play button where if clicked will play the sound over the top of it when its already playing, if that makes any sense. the sound is already called on the first frame. if the user clicks the play button again, it will play over it.

heres my play button code. i need to know what to add to add to make it check to see if the audio is already playing. My audio sound is named myMusic.

on (press) {
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(0, 999);
}
if (paused == true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(myMusicPosition, 0);
_root.myMusic.onSoundComplete = function() {
myMusic.start();
};
}
}
}

Thanks

View Replies !    View Related
Timeline Keeps Playing Even With Stop();
I've added a file, its going to be a game, but i have a problem with it:
After the power goes down to 0 (if u collide with enemy power goes down) the game takes you to the loosing screen, and there's a "replay" button there. When pressed it supposed to take you to the first frame of the main time line, but it starts looping for some reason. please help, thank u

View Replies !    View Related
How Do I Stop A Movie From Playing Over And Over
I have a square movie in the center of my page, i want it to animate anytime i resize the window, but i want it to animate only once, but it keeps going and going everytime i resize the window, how do i make it to play only once?

this is my actionscript:

stop();
square_mc.stop();

Stage.scaleMode = "noScale";
Stage.align = "LT";
Stage.height = 100;
Stage.addListener(square_mc);
square_mc.onResize = positionSquare;

function positionSquare()
{
square_mc._x = Stage.width/2 - (square_mc._width/2);
square_mc._y = Stage.height/2 - (square_mc.height/2);
square_mc.play();

}

positionSquare();
square_mc.stop();

View Replies !    View Related
Stop 1 Sound, But Keep Playing Another
Hi all.

I've a real headache with this one.

I have a preloader, with a sound loop - once the main stuff kicks in there's a video with voice over.

Now once the video kicks in, i want the previous sound loop to stop.

Its just not having it - its all or nothing.

Any ideas please?

I'm using flash mx2004, ta.

View Replies !    View Related
Stop BGM When Video Is Playing.
How should build my flash when I need my bgm to stop playing when a video clip is playing and start again when no video clip is playing. My bgm is on the main timeline and the action scrip is with in a movie clip (button).

View Replies !    View Related
Video Won't Stop Playing
Hello,
i have posted this one before, but didn't get an answer, i will try to be clearer.
i have a flvplayback on my timeline which auto loads a video. On another layer at frame 20 there is a stop command. So, the timeline stops at frame 20 but the video continues playing, all is well. There is a button on the stage that resumes the timeline by telling it to gor to frsme 21. At this point i would like the video to stop and disapear. I have tried several things, but nothing works. Please help!
thanks

View Replies !    View Related
Stop FLV From Playing When Clicking Away
I got this flv clip which plays on page load and have put the below code in on the keyframe where I have the flv clip. I've done it before (a while ago) where it worked just fine, now it doesn't.
Can anyone see what I'm missing?



PHP Code:



this.addEventListener(MouseEvent.CLICK, clickAway);
function clickAway(event:MouseEvent):void
{
instanceName.stop();





This is the error I get:

PHP Code:



TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at videoclip_fla::MainTimeline/clickAway() 

View Replies !    View Related
Non-Stop Sound Playing ...
hi ,

i want 10 wav.z get played without any delay ,
i have a 200 kb wav .. and then 9 .. 100 kb wav z
the first one will be played with a preloader and other ones should be loaded while the first one is playing , so after the first one is finished the sound will be continued ... ( i know how to attach the preloader to the first wav whay should i do about the other parts )
I got 5 days to find the answer ...so i really need any help possible.

thnk u

View Replies !    View Related
How To Stop Movieclip From Playing?
Hi, newbie here. I have a problem stopping or unloading a movieclip. I created an empty movieclip in my main timeline and loaded another movieclip(notswf) into it using the code below.

this.attachMovie("levitate", "home", 2);
stop();

I put the above code in the first frame of my main movie as i want the movieclip "levitate" to start playing automatically

(levitate is the name of movieclip i want to attach)
(home is the name of the empty movieclip)

It works. However how do I stop this movie from playing when I go to another frame or page? Thanks in advance.

View Replies !    View Related
Stop 1 Movie When Playing Another
I have a project with 5 flv files in it. I have buttons to take the user to whichever clip they would like to hear (they are audio only, with controllers).

The problem is, once you have started any of the clips playing, if you click to go to another one, the first one continues to play at the same time. Is there a simple script to tell whatever may already be playing to stop before the other one begins?

This is my first Flash project,btw-- I don't know anything! :)

View Replies !    View Related
Can't Stop The Videos From Playing
Hello, I was wondering if anyone could help me. I have quite a few videos on my web pages but they play automatically when i get to the page. and all play at once. Im trying really hard to stop them so this doesn't happen. Ive tried using the behaviors and actions but nothing is working. Could anyone help?

View Replies !    View Related
Need To Stop Audio Playing
Hi, I'm building a Flash website.

I've used frames with names to contain the different 'pages' of the site. On the frame called 'SVHS1' I've built an XML mp3 player with buttons and a volume slider.

If I press the stop button on my mp3 player and then navigate to another frame (any frame before or after ‘SVHS1’) the site works fine, and the mp3 player works perfectly if I go to that frame again. But if I navigate to another frame without first stopping the song it continues to play even though I’m not on the mp3 player frame, and if I go back to the mp3 player before the song has finished it starts playing automatically from the beginning of the first song in the XML list again and simply doubles up the sound, which is horrible. When this happens the playback controls only affect the 2nd version (understandably).

Naturally, I don't want to the user to have to press the 'Stop' button before navigating elsewhere in the site. I think this is probably quite simple to fix and I assume that I have to write some script (an eventListener and function similar to that which allows the 'stop' button to work) that tells the mp3 player to stop playing if/when the user navigates away from that frame...but I don’t know how to do this.

Any help would be much appreciated.

Thanks

Ben

The attached script is for the mp3 player frame.







Attach Code

SVHeadline1.addEventListener(MouseEvent.CLICK, SVHeadline1Clicked);
SVHeadline2.addEventListener(MouseEvent.CLICK, SVHeadline2Clicked);

var getYoutube:URLRequest = new URLRequest("http://uk.youtube.com/user/PollingStationProds");

SVHeadline3.addEventListener(MouseEvent.CLICK, SVHeadline3Clicked);


function SVHeadline1Clicked(event:MouseEvent):void
{
gotoAndPlay("SVHS1");
}

function SVHeadline2Clicked(event:MouseEvent):void
{
gotoAndPlay("SVHS2");
}

function SVHeadline3Clicked(event:MouseEvent):void
{
navigateToURL(getYoutube);
}

volume_mc.slider_mc.useHandCursor = true;

var musicReq:URLRequest;
var music:Sound = new Sound();
var sc:SoundChannel;
var currentSound:Sound = music;
var pos:Number;
var songPlaying:Boolean = false;

var xml:XML;
var songlist:XMLList;
var currentIndex:Number = 0;

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, whenLoaded);

function whenLoaded(e:Event):void
{
xml = new XML(e.target.data);
songlist = xml.song;
musicReq = new URLRequest(songlist[0].url);
music.load(musicReq);
sc = music.play();
title_txt.text = songlist[0].title;
artist_txt.text = songlist[0].artist;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}

loader.load(new URLRequest("PSPjukebox.xml"));

mp3btn_FF.addEventListener(MouseEvent.CLICK, nextSong);
mp3btn_RW.addEventListener(MouseEvent.CLICK, prevSong);
mp3btn_PAUSE.addEventListener(MouseEvent.CLICK,pauseSong);

mp3btn_STOP.addEventListener(MouseEvent.CLICK,stopSong);

function nextSong(e:Event):void
{
if (currentIndex < (songlist.length() - 1))
{
currentIndex++;
}
else
{
currentIndex = 0;
}

var nextReq:URLRequest = new URLRequest(songlist[currentIndex].url);
var nextTitle:Sound = new Sound(nextReq);
sc.stop();
title_txt.text = songlist[currentIndex].title;
artist_txt.text = songlist[currentIndex].artist;
sc = nextTitle.play();
songPlaying = true;
currentSound = nextTitle;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}

function prevSong(e:Event):void
{
if (currentIndex > 0)
{
currentIndex--;
}
else
{
currentIndex = songlist.length() - 1;
}

var nextReq:URLRequest = new URLRequest(songlist[currentIndex].url);
var prevTitle:Sound = new Sound(nextReq);
sc.stop();
title_txt.text = songlist[currentIndex].title;
artist_txt.text = songlist[currentIndex].artist;
sc = prevTitle.play();
songPlaying = true;
currentSound = prevTitle;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}

function pauseSong(e:Event):void
{
pos = sc.position;
sc.stop();
songPlaying = false;
mp3btn_PLAY.addEventListener(MouseEvent.CLICK,playSong);
}

function playSong(e:Event):void
{
if(songPlaying == false)
{
sc = currentSound.play(pos);
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
songPlaying = true;
mp3btn_PLAY.removeEventListener(MouseEvent.CLICK,playSong);
}
}

function stopSong(e:Event):void
{
sc.stop();
pos = 0;
songPlaying = false;
mp3btn_PLAY.addEventListener(MouseEvent.CLICK,playSong);
}

//----VOLUME----//
var dragging:Boolean = false;
var rectangle:Rectangle = new Rectangle(0,0,75,0);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_DOWN,dragIt);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_UP,dropIt);
stage.addEventListener(MouseEvent.MOUSE_UP,dropIt);

function dragIt(e:Event):void
{
volume_mc.slider_mc.startDrag(false,rectangle);
dragging = true;
volume_mc.slider_mc.addEventListener(Event.ENTER_FRAME, adjustVolume);
}

function dropIt(e:Event):void
{
if (dragging)
{
volume_mc.slider_mc.stopDrag();
dragging = false;
}
}

function adjustVolume(e:Event):void
{
var vol:Number = volume_mc.slider_mc.x / 75;
var st:SoundTransform = new SoundTransform(vol);
if (sc != null)
{
sc.soundTransform = st;
}
}

View Replies !    View Related
Need To Stop Audio Playing
Hi, I'm building a Flash website.

I've used frames with names to contain the different 'pages' of the site. On the frame called 'SVHS1' I've built an XML mp3 player with buttons and a volume slider.

If I press the stop button on my mp3 player and then navigate to another frame (any frame before or after ‘SVHS1’) the site works fine, and the mp3 player works perfectly if I go to that frame again. But if I navigate to another frame without first stopping the song it continues to play even though I’m not on the mp3 player frame, and if I go back to the mp3 player before the song has finished it starts playing automatically from the beginning of the first song in the XML list again and simply doubles up the sound, which is horrible. When this happens the playback controls only affect the 2nd version (understandably).

Naturally, I don't want to the user to have to press the 'Stop' button before navigating elsewhere in the site. I think this is probably quite simple to fix and I assume that I have to write some script (an eventListener and function similar to that which allows the 'stop' button to work) that tells the mp3 player to stop playing if/when the user navigates away from that frame...but I don’t know how to do this.

Any help would be much appreciated.

Thanks

Ben

The attached script is for the mp3 player frame.







Attach Code

SVHeadline1.addEventListener(MouseEvent.CLICK, SVHeadline1Clicked);
SVHeadline2.addEventListener(MouseEvent.CLICK, SVHeadline2Clicked);

var getYoutube:URLRequest = new URLRequest("http://uk.youtube.com/user/PollingStationProds");

SVHeadline3.addEventListener(MouseEvent.CLICK, SVHeadline3Clicked);


function SVHeadline1Clicked(event:MouseEvent):void
{
gotoAndPlay("SVHS1");
}

function SVHeadline2Clicked(event:MouseEvent):void
{
gotoAndPlay("SVHS2");
}

function SVHeadline3Clicked(event:MouseEvent):void
{
navigateToURL(getYoutube);
}

volume_mc.slider_mc.useHandCursor = true;

var musicReq:URLRequest;
var music:Sound = new Sound();
var sc:SoundChannel;
var currentSound:Sound = music;
var pos:Number;
var songPlaying:Boolean = false;

var xml:XML;
var songlist:XMLList;
var currentIndex:Number = 0;

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, whenLoaded);

function whenLoaded(e:Event):void
{
xml = new XML(e.target.data);
songlist = xml.song;
musicReq = new URLRequest(songlist[0].url);
music.load(musicReq);
sc = music.play();
title_txt.text = songlist[0].title;
artist_txt.text = songlist[0].artist;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}

loader.load(new URLRequest("PSPjukebox.xml"));

mp3btn_FF.addEventListener(MouseEvent.CLICK, nextSong);
mp3btn_RW.addEventListener(MouseEvent.CLICK, prevSong);
mp3btn_PAUSE.addEventListener(MouseEvent.CLICK,pauseSong);

mp3btn_STOP.addEventListener(MouseEvent.CLICK,stopSong);

function nextSong(e:Event):void
{
if (currentIndex < (songlist.length() - 1))
{
currentIndex++;
}
else
{
currentIndex = 0;
}

var nextReq:URLRequest = new URLRequest(songlist[currentIndex].url);
var nextTitle:Sound = new Sound(nextReq);
sc.stop();
title_txt.text = songlist[currentIndex].title;
artist_txt.text = songlist[currentIndex].artist;
sc = nextTitle.play();
songPlaying = true;
currentSound = nextTitle;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}

function prevSong(e:Event):void
{
if (currentIndex > 0)
{
currentIndex--;
}
else
{
currentIndex = songlist.length() - 1;
}

var nextReq:URLRequest = new URLRequest(songlist[currentIndex].url);
var prevTitle:Sound = new Sound(nextReq);
sc.stop();
title_txt.text = songlist[currentIndex].title;
artist_txt.text = songlist[currentIndex].artist;
sc = prevTitle.play();
songPlaying = true;
currentSound = prevTitle;
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
}

function pauseSong(e:Event):void
{
pos = sc.position;
sc.stop();
songPlaying = false;
mp3btn_PLAY.addEventListener(MouseEvent.CLICK,playSong);
}

function playSong(e:Event):void
{
if(songPlaying == false)
{
sc = currentSound.play(pos);
sc.addEventListener(Event.SOUND_COMPLETE, nextSong);
songPlaying = true;
mp3btn_PLAY.removeEventListener(MouseEvent.CLICK,playSong);
}
}

function stopSong(e:Event):void
{
sc.stop();
pos = 0;
songPlaying = false;
mp3btn_PLAY.addEventListener(MouseEvent.CLICK,playSong);
}

//----VOLUME----//
var dragging:Boolean = false;
var rectangle:Rectangle = new Rectangle(0,0,75,0);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_DOWN,dragIt);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_UP,dropIt);
stage.addEventListener(MouseEvent.MOUSE_UP,dropIt);

function dragIt(e:Event):void
{
volume_mc.slider_mc.startDrag(false,rectangle);
dragging = true;
volume_mc.slider_mc.addEventListener(Event.ENTER_FRAME, adjustVolume);
}

function dropIt(e:Event):void
{
if (dragging)
{
volume_mc.slider_mc.stopDrag();
dragging = false;
}
}

function adjustVolume(e:Event):void
{
var vol:Number = volume_mc.slider_mc.x / 75;
var st:SoundTransform = new SoundTransform(vol);
if (sc != null)
{
sc.soundTransform = st;
}
}

View Replies !    View Related
Movie Should Stop...but Keeps Playing
ok...I promise...I'm not on drugs.

I also apologize for the length of this...but I have to explain.

This is driving me nuts....I've done a simple presentation....large, but simple.

It's basically a demo of a product that tracks trucking fleets via GPS.
Anyway, the movie starts....goes to a certain keyframe, loads all the pretty graphics and such and the navigation, then....STOPS....waiting for a mouse click on one of the buttons. So far so good.

Now....if you click the "View Demo" button, it simply jumps down the timeline...and starts playing the demo movie...like it's supposed to.

Here's where the weird stuff starts.
Within this demo movie...I have a simple button, that allows the user to escape the demo....when clicked...it simply goes back to the begining of the timeline to a particular keyframe with a stop action on it.
And then....it stops....All good so far.

However, after a few seconds....maybe 5 or 10....it starts the demo again....just jumps down the timeline and starts playing again!!!!....There is no fancy Action Script or anything.....I'm very confused.....and am hoping that someone may shed a little light on this.

The file is huge...so posting it is no good.

Anyone?

View Replies !    View Related
Stop Sound Playing Over The Top Of Itself
Okay, i really need some help on this. I have a play button where if clicked will play the sound over the top of it when its already playing, if that makes any sense. the sound is already called on the first frame. if the user clicks the play button again, it will play over it.

heres my play button code. i need to know what to add to add to make it check to see if the audio is already playing. My audio sound is named myMusc.

on (press) {
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(0, 999);
}
if (paused == true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(myMusicPosition, 0);
_root.myMusic.onSoundComplete = function() {
myMusic.start();
};
}
}
}

Thanks

View Replies !    View Related
Stop A MC From Looping Or Playing
how to stop a movie clip from playing or looping?

i have main movie clip, i use looping to insert 'pass' movie clip into it, in 'pass' movie clip, there is a script to make 'pass' movie clip to move around, here is the logic

setinterval(move,1)

function move()
{
...........
..........
...........
.........


setinterval(rest,2000)
function rest()
{
..............................
..............................
..............................
if (pass._y == yyy)
{
//stop this pass movie clip from looping or moving or interval
}
}
}


any idea, thanks

View Replies !    View Related
How To Stop A Movie From Playing
can anyone tell me how to stop an swf playing movie?

korkor5

View Replies !    View Related
Stop A Movie From Playing
Hi
I have this clock which I just want the hand to move only by 180 degrees
So I have this code like ( not complete code here)


Code:
this.createEmptyMovieClip("myclock", 3);
/*..
...
.. some code here and then
*/

myclock.onEnterFrame = function () {
myclock.secondsHand._rotation+=1;

if( myclock.secondsHand._rotation==180)
{
trace("Wow");
myclock.stop();
}
}
but this is not working

Can someone tell me how I can stop it at 180?
I do get a trace "Wow" but it keeps on playing
Thanks

View Replies !    View Related
Stop Buttons While Mc Playing
hi i have a number of buttons in a flash movie that show different photos. It's pretty simple (you can see it here: http://www.oliperphonic.com/tst-page.html)

The problem i have is that if you click one button then impatiently click the next one it won't work as the mc is still playing and kind of gives the impression that you have to click the button twice. Is there anyway to stop the buttons from working while the clip is playing out?

Another question but not so important is: You'll notice how if you click the pics from the bottom up the previous little button fades back in and the new photo shows. However if you don't go in order from bottom to top the wrong pic fades back in (should be the last one you were on). Is there a simple way of making this so? Just some ideas would be great, i'm a bit of a flash simpleton i'm afraid.

Many thanks for any help

View Replies !    View Related
Movieclip Stop Playing
ok, i'm trying to get a movieclip within a movieclip to stop playing when it reaches its last frame.

let me describe my problem:

it should start playing when the user rolls over the movieclip that is containing it(i'll call this mc1, and the movieclip within it mc2). i've put a stop action in mc2's last frame but it won't stop and plays again and again. one thing i should point out is that there is a variable in mc1 that tells the movie whether it's ok to play the movie in reverse when the user rolls over mc1, if this is false, that means that it plays normally(not in reverse). i'm using "play()" to play mc1 when the user rolls over it and this is where i think the problem is; even though the last frame of mc2 has a stop action, it is somehow told to play again?

anyways, this is just a guess, i haven't figured out why or how to fix it. i'm not sure if my explanation was too hard to understand so i'll try to clarify it if anyone wants me to. if anyone can give me a solution, it would be very much appreciated.

-i'll try to upoad a fla asap

View Replies !    View Related
How Do I Stop A Movie From Playing
hi guys...

heres my problem. I have two movies ( A and B) playing continously in a scene ( looping). After a few seconds, I would like movie A to stop ( freeze) while movie B continues on.

How do i do this? I tried putting a "stop" action on movie A but it stops everything else including movie B.

thanks!

View Replies !    View Related
Movie Should Stop...but Keeps Playing
ok...I promise...I'm not on drugs.

I also apologize for the length of this...but I have to explain.

This is driving me nuts....I've done a simple presentation....large, but simple.

It's basically a demo of a product that tracks trucking fleets via GPS.
Anyway, the movie starts....goes to a certain keyframe, loads all the pretty graphics and such and the navigation, then....STOPS....waiting for a mouse click on one of the buttons. So far so good.

Now....if you click the "View Demo" button, it simply jumps down the timeline...and starts playing the demo movie...like it's supposed to.

Here's where the weird stuff starts.
Within this demo movie...I have a simple button, that allows the user to escape the demo....when clicked...it simply goes back to the begining of the timeline to a particular keyframe with a stop action on it.
And then....it stops....All good so far.

However, after a few seconds....maybe 5 or 10....it starts the demo again....just jumps down the timeline and starts playing again!!!!....There is no fancy Action Script or anything.....I'm very confused.....and am hoping that someone may shed a little light on this.

The file is huge...so posting it is no good.

Anyone?

View Replies !    View Related
Stop Sound Playing Over The Top Of Itself
Okay, i really need some help on this. I have a play button where if clicked will play the sound over the top of it when its already playing, if that makes any sense. the sound is already called on the first frame. if the user clicks the play button again, it will play over it.

heres my play button code. i need to know what to add to add to make it check to see if the audio is already playing. My audio sound is named myMusc.

on (press) {
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(0, 999);
}
if (paused == true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(myMusicPosition, 0);
_root.myMusic.onSoundComplete = function() {
myMusic.start();
};
}
}
}

Thanks

View Replies !    View Related
All My Sounds Stop Playing
hello everyone.

I've got a sound loop playing in the background of my movie, and when i press a certain button, the sound fades out. Everything works fine, but when i press that button, all the other sounds in the movie (button sounds) stop. And they never play again until i turn the loop back on...

this is the code that loads my loop:

ActionScript Code:
s = new Sound(  );
s.attachSound("pizz1");
s.setVolume(0);
s.start( 0 , 50000 );

it fades in and out using those code:

ActionScript Code:
s.setVolume(5);
s.setVolume(10);
s.setVolume(15);
etc...


and this is the code that loads my button sounds at the begining of the movie:

ActionScript Code:
var my_sound:Sound = new Sound(this);
my_sound.attachSound("sound1");
//
trans1.onRollOver = function() {
    my_sound.start();
};
etc...



Does anyone know why it stops all my sounds?
thanks

View Replies !    View Related
The MP3 In My Timeline Won't Stop Playing
As most newbies say, I apologize if this has been asked before. I did a search and came up with nothing, however.

I'm pretty new with Flash with almost anything except simple animations. I'm doing a project for class and have to use a song in the background. Problem is, every time I play it the animation will stop (I have figured out the 'stop' action as well... ), but the music keeps on going.

I've tried everything in the Control menu, and the only thing that gets the music to stop is clicking "test movie" or "test scene." It then goes into that mode (obviously), and the music will only stop once I exit from there and go back to the stage/timeline screen. Which is a HUGE hassle when all I'm trying to do is to line up the music with the animation.

I'm new to Flash but definitely not new to computers in general...and have racked my brain trying to figure this out. I did a search online, checked Flash's help site, and looked in the Visual Quickstart Guide for Flash that I have...and I got nothing.

I only have the beginning done to the animation, 30 seconds or so of the entire song. And, like I said, the music just keeps on going even though I really only want to see that first 30 seconds to see if everything's lined up correctly so I can finish.

Someone please help before I destroy my monitor.

View Replies !    View Related
How Do I Stop A Sound From Playing?
Here is what I currently have scripted on a button.

on (press) {
arnold.stop();
}

on (release) {

arnold.gotoAndPlay(2);
}

Arnold is the name of an instance of a movie that plays Arnold Schwartzenegger saying "No problemo"

I'm making a do it yourself arnold rap movie.

What I want to happen is when you press the button rapidly, it would say.... "no no no no no no problemo."

The problem is that the movie keeps playing and all I ever get is no problemo. I cant get it to stop halfway through his phrase when I reclick the button.

Any ideas?

Thanks!

View Replies !    View Related
Playing Only Next 5 Frames Without A Stop Action
Hello

Anyone ever tried getting a button to tell a MC to play the next 5 frames and stop? is that possible? I can't put a stop action in the movie clip because of how have this game/site set up.

any help or direction would be appreciated

cheers,

nigel

View Replies !    View Related
How To Stop All Current Playing Sound
hello how can i stop all sounds that are playing if someone enters a website so that only your sound from the site is playing
thanx



http://www.frodoshop.com

View Replies !    View Related
Movie Just Stop Playing After Compile To Swf
Hi,

I m currently doing a flash assignment where after i compile to exe or swf is about 6MB, with about 148 scenes. It runs fine but if i add in more scenes and then i compile, it is about 6.1MB then is where my problem starts. The exe or swf will play my movie half way before it stops and just can't continue anymore.

My movie is just a simple animation which doesn't involve much scripting.

Is is because there are too many scenes or the file size too big?
Please help...

View Replies !    View Related
Stop Main Swf From Playing While In Popup
is ther a way to disable script and animations in one swf while your focussed in a popup? (without sending the main menu to another frame)

thnx
thomas

View Replies !    View Related
Stop Playing Movie On Next Frame
Hello,
I have a movie that is called from a button. I use the following actionscript.
on (press) {
this.attachMovie("printoptmc", "window", 1);
window._x = 473.6;
window._y = 252.3;
}

I have navigation buttons on the screen. When the user click the next frame nav button or prev frame button I would like the movie to stop.

How do I go about this? I tried stop(); but it does not go away.

Any help appreciated.....

Thanks

View Replies !    View Related
Hide .... Stop SCREEN Playing
Hi all

Working with form screens in MX

How can I unload ...My screen

this hide my screen but my video/audio still plays

on (release) { this.setVisible(false);
}

Hope for a easy way to stop my screen playing and hide it

Have a nice day

View Replies !    View Related
[F8] Stop Flv From Playing When Changing Sections
In my video section users can press buttons to view linked flvs. my prob occurs when they want to navigate to a different section in the swf that does not have video, the flv sound stays on. can i unload the flv someway? i will post my code if you are interested. i am using a listener object (although to be honest, i'm not really sure what it does). thanks for any help

View Replies !    View Related
[F8] Mp3 Player Wont Stop Playing.
This is probably some stupid coding that I missed but, I'm stumped.

I have an MP3 player that, when selected, plays songs(Obviously) - And that works fine, but, my problem is.. If I click a song to play, then decide to browse the rest of my site - The song keeps playing.

How would I make it so that the Mp3 player stopped playing that song once I left the page? It wouldn't be such a big problem, but, when I come back to that initial page with the mp3 after browsing the rest of the site - I can't control the mp3 that is already playing. So, I figure if I put a stop on it once the page is exited - It'll solve the problem

The site is..

http://www.libertycustomchopperseats.com/Karizmatik/

and the player is on the "tracks" page.

I can upload the .FLA if anyone wants to look at the coding.

But, a tutorial, or any help would be muchly, muchly appreciated!!

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