Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-22-2003, 11:53 AM   #1
swank.inc
Mac IE bug 6.0r79 !
 
Join Date: Mar 2003
Location: Netherlands
Posts: 20
Question Stop streaming first movie when loading second, how?

This is a working example with multiple buttons which load multiple external movies containing streaming mp3, into the main_movie.

The only problem is when the second button is pressed (when the first movie is playing/streaming), it stopsAllSounds and unLoad the first movie alright, but it does not stop streaming the previous movie.

As a result (especially with a modem) it takes a mighty long time for the second movie to load/become visible because it's still busy streaming the first, although unloaded and stopped playing. The user might get confused and might think it does not work.

I think I have to use the "delete mySound" action, but don't know how to script this in the main_movie's actionscript for the mc "here". I pref. not want to rewrite the external files' actions if possible.

Please look at the files if you want to help me.

You can first look at http://www.moregraphics.nl/swank.inc/
Please hit the different buttons/tracks and see what I mean. When you have a fast connection everything goes well, but with a modem it does not.
Attached Files
File Type: zip how to stop streaming.zip (53.2 KB, 188 views)
swank.inc is offline   Reply With Quote
Old 03-23-2003, 10:07 PM   #2
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

instead of loading a new movie for each sound, just have one sound object in your main movie and load a new sound into this when each button is clicked

cheers
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 03-24-2003, 11:15 AM   #3
swank.inc
Mac IE bug 6.0r79 !
 
Join Date: Mar 2003
Location: Netherlands
Posts: 20
Default

Hi, I think I might solved the stop streaming problem, but I want to keep the functions in the external movie which shows curTime and endTime when streaming/playing from that particular mp3.

My new problem is I can't figure out how to change the path_name in the external movie's timeline and "Time mc" action to make it work.

Main_movie timeline frame 1:
ActionScript Code:
track4.onRelease = function() {     if (_root.openCheck == "close") {         here.gotoAndPlay("play");         whichMovieLoad = this._name;     } }; track5.onRelease = function() {     if (_root.openCheck == "close") {         here.gotoAndPlay("play");         whichMovieLoad = this._name;     } };

Main_movie button "track4":
ActionScript Code:
on (release) {     if (playing != true) {         playing = true;         soundIsLoaded = 1;         stream = new Sound();         stream.loadSound("track4", true);     } } on (press) {     if (playing == true) {         playing = false;         stream.stop();     } }

Main_movie button "track5":
ActionScript Code:
on (release) {     if (playing != true) {         playing = true;         soundIsLoaded = 1;         stream = new Sound();         stream.loadSound("track5", true);     } } on (press) {     if (playing == true) {         playing = false;         stream.stop();     } }

Main_movie layer with mc "here" timeline Frame 1: //inside this mc resides empty target mc "exactly"
ActionScript Code:
_root.openCheck = "close"; stop();

Main_movie mc "here" timeline Frame 2:
ActionScript Code:
whichMov = _root.whichMovieLoad+".swf"; loadMovie(whichMov, "exactly"); _root.openCheck = "open"; gotoAndStop("stop");

External movie(s) timeline frame 1:
ActionScript Code:
endPos = track4.duration; function sPos(aus, sobj) {     this[aus] = this[obj].position; } function sBuffer(obj, spobj) {     endPos = this[spobj].duration;     curPos = this[spobj].position; } function playMe() {     stopMe();     track4.start(0, 1); }

External movie layer with empty mc "Time mc"
ActionScript Code:
onClipEvent (enterFrame) {     _root.here.exactly.sPos("curPos", "track4");     _root.here.exactly.sBuffer("tempRewind", "track4");     _root.here.exactly.curtime = int(_root.here.exactly.curpos/1000);     _root.here.exactly.endtime = int(_root.here.exactly.endpos/1000); } onClipEvent (load) {     _root.here.exactly.endtime = int(_root.here.exactly.endpos/1000); }

I'm really stuck here. Could someone please look at the code and see what has to be changed? I think it's very simple, but I can't figure out what...

See next reply for the files

Last edited by swank.inc; 03-24-2003 at 06:33 PM.
swank.inc is offline   Reply With Quote
Old 03-24-2003, 06:37 PM   #4
swank.inc
Mac IE bug 6.0r79 !
 
Join Date: Mar 2003
Location: Netherlands
Posts: 20
Default files from my prevoius post

Here are the files. Please please help me with this if you find the time....
Attached Files
File Type: zip change mc.path into what.zip (50.1 KB, 168 views)
swank.inc is offline   Reply With Quote
Old 03-24-2003, 07:36 PM   #5
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

well the sound object is on _root now isn't it?
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 03-25-2003, 09:32 AM   #6
swank.inc
Mac IE bug 6.0r79 !
 
Join Date: Mar 2003
Location: Netherlands
Posts: 20
Default

Hi Billy T, I really appreciate your help, but I still can't figure out what to do. Your last reply did not help I'm affraid (I tried everything). Perhaps it's too much to ask, but could you edit the code and post it, or u/l the files with the changed code? I'm loosing valuable time with this and I would be very grateful if you could show me the code...

...I know the best way to learn Flash is to figure out myself and do not ask people what to do, but I truly believe I'm stuck here, I'm begging you
swank.inc is offline   Reply With Quote
Old 03-25-2003, 09:52 AM   #7
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

why don't you put it all on the main timeline and forget the external movies altogether?
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 03-25-2003, 10:05 AM   #8
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

I can't even see where you are loading the sounds
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 03-26-2003, 06:58 PM   #9
swank.inc
Mac IE bug 6.0r79 !
 
Join Date: Mar 2003
Location: Netherlands
Posts: 20
Default

Hi Billy T, I did edit the code so it will stop streaming in Netscape 6 Mac but not in IE 5.1 Mac... When tested locally, I even got the preloader working but it does not show the playtime yet. When tested on-line it also no longer shows the total time correctly (bummer). Exept for the possible IE Mac bug (yes, using 6.0r79 plug-ins), I'm only 2 problems away, I'm getting closer! Would you please look at the code, or better yet, the files once more?

ActionScript Code:
//play button main_movie on (release) {     _root.createEmptyMovieClip("soundLib", 1);     soundLib.createEmptyMovieClip("track4hold", 1);     track4 = new Sound(soundLib.track4hold);     track4.loadSound("track4", true); } //stop button main_movie on (press) {     function removeSound() {     }     delete track4;     soundLib.removeMovieClip(); }

ActionScript Code:
// time line frame 1 ext_movie endPos = _root.track4.duration; function sPos(aus, sobj) {     this[aus] = this[obj].position; } function sBuffer(obj, spobj) {     endPos = this[spobj].duration;     curPos = this[spobj].position; } // empty mc on stage ext_movie onClipEvent (enterFrame) {     here.exactly.sPos("curPos", "track4");     here.exactly.sBuffer("tempRewind", "track4");     _root.here.exactly.curtime = int(_root.here.exactly.curpos/1000);     _root.here.exactly.endtime = int(_root.here.exactly.endpos/1000); } onClipEvent (load) {     _root.here.exactly.endtime = int(_root.here.exactly.endpos/1000); }
Attached Files
File Type: zip change path into what.zip (29.4 KB, 167 views)
swank.inc is offline   Reply With Quote
Old 03-26-2003, 08:36 PM   #10
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

well now I can't see where you are loading the external movies

shouldn't this

endPos = _root.track4.duration;

be this

endPos = _root.soundLib.track4hold.track4.duration;

?
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:33 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.