• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

add sound

Explorer ,
Aug 03, 2023 Aug 03, 2023

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! AlanYScreenshot 2023-08-03 134220.png

Views

7.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 20 Correct answers

Community Expert , Aug 03, 2023 Aug 03, 2023

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.)

Votes

Translate

Translate
Explorer , Aug 16, 2023 Aug 16, 2023

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!

 

Votes

Translate

Translate
Community Expert , Aug 16, 2023 Aug 16, 2023

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.

Votes

Translate

Translate
Explorer , Aug 17, 2023 Aug 17, 2023

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.

 

Votes

Translate

Translate
Community Expert , Aug 22, 2023 Aug 22, 2023

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)

kglad_0-1692718566532.png

 

Votes

Translate

Translate
Community Expert , Aug 22, 2023 Aug 22, 2023

double click to the right of the highlighted box shown in your screenshot.

 

kglad_0-1692720024406.png

 

Votes

Translate

Translate
Community Expert , Sep 04, 2023 Sep 04, 2023

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.

Votes

Translate

Translate
Community Expert , Sep 04, 2023 Sep 04, 2023

excellent news!!!!

Votes

Translate

Translate
Community Expert , Sep 05, 2023 Sep 05, 2023

to close the browser tab, window.close();

Votes

Translate

Translate
Community Expert , Sep 07, 2023 Sep 07, 2023
NativeApplication.nativeApplication.exit(); 

 

Votes

Translate

Translate
Community Expert , Sep 10, 2023 Sep 10, 2023

you need to assign the linkage id to your library sound.

Votes

Translate

Translate
Community Expert , Sep 10, 2023 Sep 10, 2023

are you calling start_soundF()?

Votes

Translate

Translate
Community Expert , Sep 12, 2023 Sep 12, 2023

check the publish folder.  there's probably an exe.

 

if not, change your target, too.

Votes

Translate

Translate
Community Expert , Sep 12, 2023 Sep 12, 2023

it's in the output name field path which in your screenshot is the same as the folder where you're saving your fla.

Votes

Translate

Translate
Community Expert , Sep 20, 2023 Sep 20, 2023

you have to use a non-self signed digital certificate, https://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff0.html

Votes

Translate

Translate
Community Expert , Sep 24, 2023 Sep 24, 2023

the same code will work for all air (desktop, ios, android) versions.

Votes

Translate

Translate
Community Expert , Sep 25, 2023 Sep 25, 2023

nice.  you're doing your own troubleshooting.

Votes

Translate

Translate
Community Expert , Sep 27, 2023 Sep 27, 2023

(it's definitely getting easier to help you.)

Votes

Translate

Translate
Community Expert , Sep 29, 2023 Sep 29, 2023

@Alan5E07 

 

that apk (=android package file) is the installer file.

Votes

Translate

Translate
Community Expert , Oct 02, 2023 Oct 02, 2023

contact apple support for help.  

 

p.s. did you pay the $100+?

Votes

Translate

Translate
replies 188 Replies 188
Community Expert ,
Aug 29, 2023 Aug 29, 2023

Copy link to clipboard

Copied

you have a typo in line 5433 of that backup js file.

 

if you don't understand how to fix that, copy and paste lines ~5420 to ~5450 from that js file

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 30, 2023 Aug 30, 2023

Copy link to clipboard

Copied

Hi

Sorry but I don't understand about js files or how to get that information.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 30, 2023 Aug 30, 2023

Copy link to clipboard

Copied

when you test or publish animate creates several files, by default, in the folder where you save your fla.  you'll find your js file there.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 30, 2023 Aug 30, 2023

Copy link to clipboard

Copied

Reverted back to copy I had saved before it all went wrong. I thought it was easier to do that! This copy Plays the sound in full in the 1-28 area but still keep playing when I move out of the area. nothing added to the button listners so far! I can try again with some help from your good self!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 30, 2023 Aug 30, 2023

Copy link to clipboard

Copied

now change one button listener per my last message with that code

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 30, 2023 Aug 30, 2023

Copy link to clipboard

Copied

Runs through to frame 51 and stops with music playing all the time. Maybe I have the stop sound in the wrong place.

Alan5E07_0-1693411091725.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 30, 2023 Aug 30, 2023

Copy link to clipboard

Copied

on frame 1 use:

 

this.sound1 = createjs.Sound.createInstance("soundId");  // eg, if linkage id = soundId

 

this.stop_soundF = function(){

this.sound1.stop()

}

this.start_soundF = function(){

this.sound1.play()

}

 

 

for the button_5 listener function use:

 

function fl_ClickToGoToAndStopAtFrame6(){

this.gotoAndStop(51);

this.stop_soundF();

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 31, 2023 Aug 31, 2023

Copy link to clipboard

Copied

runs through to frame 51 and stops but with no sound at all from 1-51

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2023 Aug 31, 2023

Copy link to clipboard

Copied

you must use:

 

this.start_soundF()

 

to start the sound.  that's a change from my previous suggestion(s) which did not include the keyword "this"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 31, 2023 Aug 31, 2023

Copy link to clipboard

Copied

Sound plays runs through to 51 sound plays continuously.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2023 Aug 31, 2023

Copy link to clipboard

Copied

did you click button_5 prior to frame 51?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

Hi

No never click 5 frames just ran continuously from frame 1-51.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

@Alan5E07 

 

what does this mean, "No never click 5 frames just ran continuously from frame 1-51"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

I never got a chance to click button 5 because the test ran from frame 1-51 all the way through, without stopping at frame 28. and the sound played all the way too.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

if you have something to stop the timeline on frame 28, open the console to check for errors.

 

p.s.  punctuation often helps clarify your writing. eg, a period after click 5, would have been helpful.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

Create a movieclip for your audio and make the audio as Event under the Sound properties. Now bring that movie clip to the main stage. In the 28th frame, anyways the animtion stops and waits for the user to click any one option, so in all the buttons that you have at the 28th frame, just add a the action: SoundMixer.stopAll(); within the eventlistener of each button. Now the audio will stop and if you have any other audio that is part of each section of the buttons, just place those musics within the particular movieclip. So when you come back to the home screen, by clicking any of the buttons from each of your sections, again add the same code for those buttons: SoundMixer.stopAll();. Now what this does again is, it will stop all the sounds and when it returns to the main home screen, it will start playing the movieclip audio that was added for the beginning section. One important thing here is, this will work, only if the audio is kept as event under the Sound properties. If this doenst help, I Happy to solve this once when you share a sample of your work by changing any confidential data from the file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

@Giddy_personality5D25 

 

canvas project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

Hi Don't know how to make movieclip!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

@Alan5E07 

 

ignore @Giddy_personality5D25 message. while well-meaning, it doesn't apply to your project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 01, 2023 Sep 01, 2023

Copy link to clipboard

Copied

ok

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 02, 2023 Sep 02, 2023

Copy link to clipboard

Copied

Alan5E07_0-1693647103170.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 02, 2023 Sep 02, 2023

Copy link to clipboard

Copied

copy and paste here the code for your button 5 on your ~27th frame (which should look like)

 

 

this.button_5.addEventListener("click", fl_ClickToGoToAndStopAtFrame6.bind(this));

 

function fl_ClickToGoToAndStopAtFrame6(){

this.gotoAndStop(51);

this.stop_soundF();

}

 

=============================

from the error message it looks like only 

 

this.button_5.addEventListener("click", fl_ClickToGoToAndStopAtFrame6.bind(this));

 

is present and not the rest of the code i suggested.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 04, 2023 Sep 04, 2023

Copy link to clipboard

Copied

Hi Alan,

Have attached fla file. Please run the file and let me know if this is what you are trying to achieve. A music starts playing in the beginning until a certain frame and stops for the usr to click on any of the options. Have kep 4 grey buttons that jumps to 4 different frames and a green button to jump to the beginning of the file. Whenever you click on any of the 4 grey buttons, it stops the music and goes to that particular frame. and when you click on the green button, it goes to the beginning and plays the music again.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 04, 2023 Sep 04, 2023

Copy link to clipboard

Copied

@Giddy_personality5D25 

 

you didn't (and can't) attach a fla file to adobe's forums.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 04, 2023 Sep 04, 2023

Copy link to clipboard

Copied

this.button_5.addEventListener("click", fl_ClickToGoToAndStopAtFrame_6.bind(this));

function fl_ClickToGoToAndStopAtFrame6(){

this.gotoAndStop(51);

this.stop_soundF();

}

This code is on frame 28 not frame 27

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines