Copy link to clipboard
Copied
Hi Guys
I managed to get all my buttons work correctly. now i need some help with sound/music. I need the title music to play at the start of my project frames 1-28 where my first bit of frame by frame animation runs with it. But when I test project the animation runs ok but no music. But when i press button to go to another part of the project and return to home page the animation plays ok again and the music to but only for the duration of the short animation. I need the music the keep playing in that area 1/28 until the user press a button and move on.
Help! AlanY
put a stop() in your first frame and an intro message along with a button/movieclip to click to trigger your timeline to play().
(user's have to interact with browser files to permit sound to play.)
Hi I got the start button working ok.plays the animation to frame 28 and stop thats what I want. But I would like to have the musicto play at the same time and keep it confined inbetween frames 1 and 28 if that is possible!
it would be easier for you to add your start button to frame 1 and then put your sound on frame 2.
but you can start your sound with code on frame 1, if that's what you want to do.
That works to keep the sound in 1-28 but the sound now stops playing at 28. Would like the music to keep playing the hole music at 28 until the user clicks another button to take them out of that area.
yes, those are the sound functions. but you don't want to call start_soundF() until you want the sound to start and you don't call stop_soundF() until you want the sound to stop.
double click the linkage field > enter soundId (uppercase i, 9th letter in alphabet)
double click to the right of the highlighted box shown in your screenshot.
the listener function call and function name don't match. ie,
fl_ClickToGoToAndStopAtFrame_6
is not the same as
fl_ClickToGoToAndStopAtFrame6
ie, change one of them so they match.
excellent news!!!!
to close the browser tab, window.close();
NativeApplication.nativeApplication.exit();
you need to assign the linkage id to your library sound.
are you calling start_soundF()?
check the publish folder. there's probably an exe.
if not, change your target, too.
it's in the output name field path which in your screenshot is the same as the folder where you're saving your fla.
you have to use a non-self signed digital certificate, https://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff0.html
the same code will work for all air (desktop, ios, android) versions.
nice. you're doing your own troubleshooting.
(it's definitely getting easier to help you.)
contact apple support for help.
p.s. did you pay the $100+?
Copy link to clipboard
Copied
there's no code shown to stop the sound.
do you still have your sound attached to a timeline?
Copy link to clipboard
Copied
Morrning I have a confession to make looking back on our conversations you told me to put the sound on event I did'nt do that and it was streem! My mistake sorry. So now I have the full music playing in area1-28 good thats what I wanted but now the still plays outside the area when a button is click to go outwith. And I think I mite be putting the stop the sound code in the wrong places.
Copy link to clipboard
Copied
ps. Yes the sound still attached to a timeline
Copy link to clipboard
Copied
1. remove the sound from the timeline
2. add to your main timeline first frame
//////////////////////////////////////////////// start code ///////////////////////////////////////
var sound1 = createjs.Sound.createInstance("soundId"); // eg, if linkage id = soundId
function play_soundF(){
sound1.play();
}
function stop_soundF(){
createjs.Sound.stop();
}
//////////////////////////////////////////// end code ///////////////////////////////////////////////////
3. in frame 1 of your main timeline add
play_soundF();
4. to one of your button listeners add
stop_soundF();
5. test that one button.
6. if that one button works the way you want, add stop_soundF() to your other button listeners
p.s.
this.blahblah.addEventListener("click",dowhateverF.bind(this));
function dowhateverF(){
// this is a a button listener so your listeners that exit frames 1-28 add:
stop_soundF();
}
Copy link to clipboard
Copied
Hi follow your guid. It works good what I want music to play with animation and waits for next button click. But when click to out of area it still keep playing. Tryed two of button listners (pasted in stop_soundF(); but did not work as music contued to play outside the area 1-28 I think we are getting close to solving the problem.
Thanks again for all your help
Copy link to clipboard
Copied
copy and paste one of the two button listeners with stop_soundF().
Copy link to clipboard
Copied
That did'nt work either
Copy link to clipboard
Copied
what?
i didn't make any suggestion to fix anything. i asked that you copy and paste the code you're using to this forum so i can see what you're doing.
Copy link to clipboard
Copied
I copyed and pasted stop_soundF(). into one of my button listners
Copy link to clipboard
Copied
show me your code.
Copy link to clipboard
Copied
This may help!
Copy link to clipboard
Copied
that's not in a listener and has an error.
Copy link to clipboard
Copied
Thats some of the buttons on the front page
Copy link to clipboard
Copied
i don't see stop_soundF() there!?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
move stop_soundF() just after line 16
then test that button
Copy link to clipboard
Copied
music started play indicator moved along the time line and stopped at frame 51
Copy link to clipboard
Copied
ps Music coninued to play throughout and still play when timeline stopped.
Copy link to clipboard
Copied
the timeline playing/stopping isn't going to make any difference regarding whether your sound plays or stops once you get this right.
are you've still not shown any code with stop_soundF() placed correctly within your code. and because you're using screenshots to show your code, i can't copy your code and then correct it.
but really, can't you see how this applies to your code:
/////////////// begin code //////////////////////////
this.button_5.addEventListener("click",fl_ClickAndGoToAndStop6.bind(this));
function fl_ClickAndGoToAndStop6(){
this.gotoAndStop(51);
stop_soundF();
}
Copy link to clipboard
Copied
Hi again
This what I put in so far.
/////////////// begin code //////////////////////////
this.button_5.addEventListener("click", fl_ClickToGoToAndStopAtFrame_6.bind(this));
function fl_ClickToGoToAndStopAtFrame_6(){
this.gotoAndStop(51);
stop_soundF().
}
But when I try to test nothing happens!
Copy link to clipboard
Copied
nothing happens?
eg, previously, after clicking that button, you saw the timeline change to frame 51 and now you do not see that frame change?
Copy link to clipboard
Copied
When I test it go's to internet page and is just blank does not load program
Copy link to clipboard
Copied
open the console and post the error(s).
Copy link to clipboard
Copied
Copy link to clipboard
Copied