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
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.)
Copy link to clipboard
Copied
Hi Not exactly what I am looking for. My project starts automatically with the frame by frame animation and the cursor start frame one and stops at frame 28. I would like for the music to play at the same time but to be kept between frames 1-28 and to continue to play untill the user clicks a button that will take them out of the area. The music is quite lengthy but I need it to only play in that area 1-28 frames
Copy link to clipboard
Copied
you can't (thank goodness) play sound in a browser without user interaction. think about it.
Copy link to clipboard
Copied
Ok understand just new to this. quick question my music is 165 frames long can I compress it all into 1-28 frame and play only in that space?
Copy link to clipboard
Copied
yes. use event for its sync property and, if started at frame 1, it will play in its entirety even if you stop at frame 1 ( or 28).
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi I got the start button work and the music playing with the animation and stops at frame 28 all good so far thanks for the info. next hurdle how can I keep the music playing only between 1-28. at the moment it plays outside these frames
Copy link to clipboard
Copied
have you assigned your sound's sync property to stream? is so, put an empty keyframe on frame 29 of the sound's layer.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
you should probably use code to start and stop your sound to gain that much control.
Copy link to clipboard
Copied
can you give me an example of how to do that!
Copy link to clipboard
Copied
assign your sound a linkage id (in your animate library).
// then create your sound instance
var sound1 = createjs.Sound.createInstance("soundId"); // eg, if linkage id = soundId
to start your sound call play_soundF()
to stop your sound call stop_soundF()
function play_soundF(){
sound1.play();
}
function stop_soundF(){
createjs.Sound.stop();
}
Copy link to clipboard
Copied
sorry dont understand all that stuff.. Can you make it simpler for me?
Copy link to clipboard
Copied
copy and paste:
//////////////////////////////////////////////// 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 ///////////////////////////////////////////////////
then call the play and stop functions when needed.
Copy link to clipboard
Copied
sorry still not geting this copy and paste I understand but dont know were to paste it into!
Copy link to clipboard
Copied
paste it into frame one of your main timeline.
Copy link to clipboard
Copied
tried that when I move out of the 1-28 area it still keeps playing
Copy link to clipboard
Copied
did you call start_soundF to start your sound?
did you call stop_soundF when you "move out of the 1-28 area"?
Copy link to clipboard
Copied
Dont know how to start soundF or how to stop soundF moving out of the area.
Copy link to clipboard
Copied
use:
start_soundF(); // to start your sound
stop_soundF(); // to stop your sound
Copy link to clipboard
Copied
still keeps cutting of sound at frame 28
Copy link to clipboard
Copied
did you remove sound from your timeline?
Copy link to clipboard
Copied
no