A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 27

Thread: CS4 Controlling Sound in a Slide Presentation Without Buttons?

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    13

    Unhappy CS4 Controlling Sound in a Slide Presentation Without Buttons?

    I have created a presentation in flash cs4 with 20 slides for a non-profit org totally pro bono. I am at the end and needed to add a snippet of Aretha Franklin's song Respect. I created a movieclip with the song snippet and text. I added all the necessary frames to let the clip play in it's entirety. I also added a keyframe with a stop command at the end of the movie clip. I added the movieclip to slide 14 and the when testing my slide presentation the song plays at the beginning through the end of the whole slideshow.

    I need to figure out how to have the song snippet play only once when the presenter goes to slide 14. Ideally the presenter would click next from slide 13 and the song would begin and then stop when played. The presenter would then have time to discuss the text and snippet on the screen before moving to the next slide or having to click any stop or start buttons.

    Is this Possible??? Please help I am under the gun here and would appreciate any advice.

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    At the beginning of slide 14 place this code( or similar)
    PHP Code:
    var Sound1 = new Sound();
    Sound1.attachSound("Respect"); 
    import your sound to the flash library and give it an AS Linkage name, in this case "Respect"

    at the end of the slide or the beginning of the next slide use this code or similar
    PHP Code:
    Sound1.stop(); 
    or
    PHP Code:
    Sound1.pause(); 
    whichever suits your needs.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    13
    Hi there FruitBeard! Thank you so much for your reply. Now if you don't mind can you please hold my hand through my next questions as I am a bit of a novice here;
    1) I am assuming this code can be pasted directly into the action script on any layer or key frame I wish?
    2) I have the song in my library as a mp3 file and then I used it inside a movie clip to animate with the text R-E-S-P-E-C-T. When you say give it an "AS" linkage name what does that mean or how do I go about creating an AS linkage name?
    3) Will I have to add the first code inside my movie clip and the slide it will be presented on? Or just one or the other?

    Again, thank you so much for taking time out of your day or night to give me some much needed advice and help. I will run through this code and see if I can make it work and I look forward to your reply as this will be a test on my part.

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Sorry, missed a bit out
    PHP Code:
    var Sound1 = new Sound();
    Sound1.attachSound("Respect"); 
    Sound1.start(0,1); 
    you can even do this
    PHP Code:
    var Sound1 = new Sound();
    Sound1.attachSound("Respect"); 
    Sound1.start(0,1);
    // on completion stop
    Sound1.onSoundComplete = function() {
    Sound1.stop();
    // or go to next slide command
    }; 
    it will only play once anyway
    Last edited by fruitbeard; 01-03-2013 at 01:11 PM.

  5. #5
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    I dont think he answered this so ^ for setting a linkage name right click an item in your library and click linkage, than click export for action script and where it says identifier: type the name you need to put

  6. #6
    Junior Member
    Join Date
    Jan 2013
    Posts
    13

    Wink

    Thanks Bacon!
    I was just getting ready to reply asking just that. THANK YOU! THANK YOU! THANK YOU! Now I hope it all works

  7. #7
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    To give an AS Linkage name, one way is how Bacon said or you can just look at the library and you can see the words AS Linkage to the right of Name, double click the corresponding line underneath AS Linkage and type the name in there.

    You can put the sound code on the main timeline, no need to use it inside a MovieClip or on any timeline, just library.

    As for the R-E-S-P-E-C-T, that will need some skillful timing on your behalf.

    (Why do people say "than" when it should be "then")
    Last edited by fruitbeard; 01-04-2013 at 04:11 AM. Reason: Typos

  8. #8
    Junior Member
    Join Date
    Jan 2013
    Posts
    13

    Not working properly?

    I have attempted to use all the coding available to me and have been unsuccessful in making this work correctly. First let me state that this is for a Presentation Slide similar to a powerpoint design. The music only plays through the whole presentation even with stop commands in place at the beginning of each frame on each of the 20 slides except for the slide where the music will play.

    HELP! Meeting is tomorrow at 10am and I am not sure I am going to pull this off???

  9. #9
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    I dont get your problem but if you reply quickly to me i'll help you as fast as I can before tommorow

  10. #10
    Junior Member
    Join Date
    Jan 2013
    Posts
    13

    Unhappy Still Unable to Make This Stop and Start?

    Hello again,
    Displayed the current slide presentation to the board this morning without music. However, there will be several more classes (slide presentations) that will need to be created that will also use music on certain slides only.

    This is the command I have at the beginning of each slide (which I have altered several ways without success)
    Sound1.stop();

    At the beginning of slide 14 I have this code;
    var Sound1 = new Sound();
    Sound1.attachSound("Respect");
    Sound1.start(0, 1);
    //on completion stop
    Sound1.onSoundComplete = function() {
    Sound1.stop();
    //or go to next slide command
    };
    Last edited by kabinfever; 01-05-2013 at 11:51 PM.

  11. #11
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    can you post the .fla file somewhere for me to download and just tell me what you want? exactly lol im bored

  12. #12
    Junior Member
    Join Date
    Jan 2013
    Posts
    13

    What I am trying to do and what it is doing.....

    For some reason this forum is truncating my responses?? I am a technological calamity this week

    Anyways, I was trying to say that this is for a Flash CS4 Slide Presentation, I am not using a main timeline with named frames or scenes. It is very similiar to a powerpoint type layout. With that said, when I start the slideshow the music starts as well and plays independtly of the slideshow and the 20 slides.

    I only want the song to start on slide 14 and stop at the end of slide 14, it should not play on at any other time during the presentation. There will be several classes that I have to create presentations for that will also use sound/song snippets on particular slides only. Can you please help me? I am sure it is something silly that I am missing but I am seriously stuck and have exhausted all avenues to figure this out on my own. What is that I am missing in the script to make this function as it should?

    Thank you in advance for any help you may be able to provide.

  13. #13
    Junior Member
    Join Date
    Jan 2013
    Posts
    13
    Quote Originally Posted by Alloy Bacon View Post
    can you post the .fla file somewhere for me to download and just tell me what you want? exactly lol im bored
    The file is 59.8 mb and is to large to add to this forum, can you suggest a way to get this file to you? Dropbox maybe? I believe it is a fairly straight forward problem and I am so thankful you are willing to spend your bored time lending me a hand. Please tell me how to proceed and I will do whatever is needed.

    Thank you so much! It is people like you that make this a tolerable world!

  14. #14
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    easy bro just put this on the next time line frame: stopAllSounds();

    (just incase you didnt get that ) ^
    If the sound is on frame 14 than put the sound on frame 14 and than on frame 15 put this code on the timeline: stopAllSounds(); or what ever frame you are going to after 14.

    sorry misread your post after I put that ^

    I dont get what you mean by not using a timeline what are you using than screen shots please?


    fruitbeard: I say than, then, den whatever I dont really care :P I suck at grammar
    Last edited by AS3.0; 01-06-2013 at 12:40 AM.

  15. #15
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    waiting for you to reply for like an hour, whatever ima sleep now lol sorry

  16. #16
    Junior Member
    Join Date
    Jan 2013
    Posts
    13
    https://www.dropbox.com/s/vuwlsnzb4f..._slideshow.fla Here is a link to the file. You should be able to go directly to the link for the complete download. So sorry you were waiting around for me, had to eat and put my little munchkin down. I am not a "Bro" but maybe I am a "Bra" lol..............

    (don't laugh, this is the beginning stages lol), please see that this is created as a Flash CS4 Slide Presentation. If you are using Flash CS4 (not sure if this is still a feature on 5 or 6) go to file>New> and you will see Flash Slide Presentation as one of the options, this is the style of layout that I am using.

    I believe the coding that I am after is going to be a bit more complex and require scripting that would look similar to the syntax of the next and previous buttons like this:

    on (release) {

    // GoTo Next Screen behavior
    var screen = null;
    var target = this;
    while((screen == null) && (target != undefined) && (target != null))
    {
    if(target instanceof mx.screens.Screen)
    {
    screen = target;
    }
    else
    {
    target = target._parent;
    }
    }
    if(screen instanceof mx.screens.Slide)
    {
    screen.rootSlide.currentSlide.gotoNextSlide();
    }
    // End GoTo Next Screen behavior

    }

  17. #17
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Sorry, i can not open the document and I never really knew or used any of these flash slide presentations, alas, the code you have scrambled around this thread should enable you to start , stop the music as and when required.

    All yours than Bacon.

  18. #18
    Junior Member
    Join Date
    Jan 2013
    Posts
    13
    Well that is never what a girl wants to hear....... you are giving up so easily? I was hoping that based on the next and previous buttons one of you could help me navigate some coding that would specify slide number stop and start or something to that effect?

    I am so screwed.................

    How would you propose I go about doing this easily? Should I convert to scenes?

  19. #19
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Having never used flash slide presentation, I would have gone for using a different frame for a different slide, using a movie clip on each, or if the slides are not too long then chunks of frames for each slide.

    Many people suggest that using scenes is not such a good idea although i have never had any problems with them when used(rarely).

  20. #20
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,404
    Honestly this is the most confusing thing ever lol I would have just made the thing using frames and you would have no problems, I can't help either I recommend turning on a boom box on slide 14 :P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center