|  | Sound Complete or Listener |  | |
| | | Toe Cutter |  |
| Posted: Wed Jun 18, 2008 3:44 pm Post subject: Sound Complete or Listener |  |
Greetings,
I'm trying to get a simple script to work in Flash 8.
Background: -a stretched out mp3 in a movieclip with a stop(); applied to the end, inside of that movieclip. -the movieclip is named. -the action layer above the movieclip has a stop(); at the end.
Purpose: To have the playhead advance one frame after the music is finished playing.
Results: Song finishes and remains stopped.
Examples tried:
myclip.onSoundComplete = function() { nextFrame(); trace("media is Finished"); };
or
var myListener = new Object(); myListener.complete = function(eventObject) { nextFrame(); }; myclip.addEventListener("complete", myListener);
Can someone help me?
Regards, Toe Cutter |
| |
| | | Noelbaland |  |
| Posted: Thu Jun 19, 2008 8:15 am Post subject: Re: Sound Complete or Listener |  |
Hello there,
"-a stretched out mp3 in a movieclip with a stop(); applied to the end, inside of that movieclip."
Since you have the sound stretched out along the timeline you should just add a _root.nextFrame(); under the stop(); at the end. That will advance your main timeline by one frame.
Or is there something else that happens? |
| |
| | | Toe Cutter |  |
| Posted: Thu Jun 19, 2008 6:13 pm Post subject: Re: Sound Complete or Listener |  |
Hi Noelbaland,
Thank you for responding. I understand what you have suggested. I'll try this and respond again ASAP.
Regards, ToeCutter
"Noelbaland" <webforumsuser@macromedia.com> wrote in message news:g3d4il$9oh$1@forums.macromedia.com...
| Quote: | Hello there,
"-a stretched out mp3 in a movieclip with a stop(); applied to the end, inside of that movieclip."
Since you have the sound stretched out along the timeline you should just add a _root.nextFrame(); under the stop(); at the end. That will advance your main timeline by one frame.
Or is there something else that happens?
|
|
| |
| | | Toe Cutter |  |
| Posted: Mon Jun 23, 2008 8:43 pm Post subject: Re: Sound Complete or Listener |  |
Hi again,
I tried that and here is what happens:
The sound plays, but the image on the root that should be seen while the audio in the MC plays. Why does the image disappear?
-ToeCutter
"Toe Cutter" <newsgroup@macromedia.com> wrote in message news:g3eeko$qj5$1@forums.macromedia.com...
| Quote: | Hi Noelbaland,
Thank you for responding. I understand what you have suggested. I'll try this and respond again ASAP.
Regards, ToeCutter
"Noelbaland" <webforumsuser@macromedia.com> wrote in message news:g3d4il$9oh$1@forums.macromedia.com... Hello there,
"-a stretched out mp3 in a movieclip with a stop(); applied to the end, inside of that movieclip."
Since you have the sound stretched out along the timeline you should just add a _root.nextFrame(); under the stop(); at the end. That will advance your main timeline by one frame.
Or is there something else that happens?
|
|
| |
| | | Noelbaland |  |
| Posted: Tue Jun 24, 2008 12:49 am Post subject: Re: Sound Complete or Listener |  |
Hello there,
Can you put the image inside the mc with the mp3 in it? If so, make sure to stretch the image's timeline out to the same as the mp3.
If that doesn't work can you tell me a little more about how you have your main timeline set-up?
Thanks |
| |
| | | Toe Cutter |  |
| Posted: Tue Jun 24, 2008 2:17 pm Post subject: Re: Sound Complete or Listener |  |
| |  | |
Hi Noelbaland,
I don't know why I had an issue with the main timeline image not showing up while the MP3 in the MC was playing, but after I tried sticking the image in the MC (it worked in this case) and then cleared the frames in the image layer, the maintimeline seemed to show the image again. WEIRD! Perhaps the blank layer above the MP3 layer is necessary in the MC?
Anyway, now that it is showing the image, I'm still stuck on the Actionscript. Here is what I have:
Main timeline is meant to play a slide with an MP3. (There are 9 of these slide/MP3 sets) The image is on the main timeline with a "stop();" in the actions layer after each image. The sound layer on the main timeline is where the MC of MP3 goes and it is in there where I applied your script and additional trials and errors.
Here are some of the terrible things I was trying:
stop(); //_root.nextFrame(); //_root.Frame("394"); gotoAndPlay(this._parent(394));
(Sidenote: the main timeline has the stop applied to frame 393)
Another thing I tried was this:
mySound_mc = new Sound(); mySound_mc.attachSound("burlington"); mySound_mc.start();
mySound_mc.onSoundComplete = function () { // Intro's done. Display the chapter1 menu. _level0.gotoAndStop("mall02"); }
Please advise. Thank you, ToeCutter
"Noelbaland" <webforumsuser@macromedia.com> wrote in message news:g3pga7$50d$1@forums.macromedia.com...
| Quote: | Hello there,
Can you put the image inside the mc with the mp3 in it? If so, make sure to stretch the image's timeline out to the same as the mp3.
If that doesn't work can you tell me a little more about how you have your main timeline set-up?
Thanks
|
|
| |
| | | Toe Cutter |  |
| Posted: Tue Jun 24, 2008 4:54 pm Post subject: Re: Sound Complete or Listener |  |
| |  | |
Well, nothing is quite as satisfying than stumbling upon the truth. Thank you Noelbaland for pointing me in the right direction because here is what worked:
stopAllSounds(); _root.gotoAndPlay(394);
Yeehaaw!
Regards, ToeCutter "Toe Cutter" <newsgroup@macromedia.com> wrote in message news:g3r6n3$2ht$1@forums.macromedia.com...
| Quote: | Hi Noelbaland,
I don't know why I had an issue with the main timeline image not showing up while the MP3 in the MC was playing, but after I tried sticking the image in the MC (it worked in this case) and then cleared the frames in the image layer, the maintimeline seemed to show the image again. WEIRD! Perhaps the blank layer above the MP3 layer is necessary in the MC?
Anyway, now that it is showing the image, I'm still stuck on the Actionscript. Here is what I have:
Main timeline is meant to play a slide with an MP3. (There are 9 of these slide/MP3 sets) The image is on the main timeline with a "stop();" in the actions layer after each image. The sound layer on the main timeline is where the MC of MP3 goes and it is in there where I applied your script and additional trials and errors.
Here are some of the terrible things I was trying:
stop(); //_root.nextFrame(); //_root.Frame("394"); gotoAndPlay(this._parent(394));
(Sidenote: the main timeline has the stop applied to frame 393)
Another thing I tried was this:
mySound_mc = new Sound(); mySound_mc.attachSound("burlington"); mySound_mc.start();
mySound_mc.onSoundComplete = function () { // Intro's done. Display the chapter1 menu. _level0.gotoAndStop("mall02"); }
Please advise. Thank you, ToeCutter
"Noelbaland" <webforumsuser@macromedia.com> wrote in message news:g3pga7$50d$1@forums.macromedia.com... Hello there,
Can you put the image inside the mc with the mp3 in it? If so, make sure to stretch the image's timeline out to the same as the mp3.
If that doesn't work can you tell me a little more about how you have your main timeline set-up?
Thanks
|
|
| |
| | | Noelbaland |  |
| Posted: Wed Jun 25, 2008 1:25 am Post subject: Re: Sound Complete or Listener |  |
Hello Toe Cutter,
Glad you found the solution and I could be of help! |
| |
|
|