A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Sound won't play when published

  1. #1
    Junior Member
    Join Date
    Feb 2005
    Location
    Central Florida
    Posts
    7

    Sound won't play when published

    I have tried every thing I know. I have 4 buttons with sounds attached to them. Whe I preview the movie with Ctrl+Enter the buttons play the sounds fine. If I publish the movie in an .swf or .exe file the sounds won't play. There has got to be something very simple that I am overlooking.
    Thanks in advance,
    Russ

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Did you add the sound to a frame of the button, or are you using code?

  3. #3
    Junior Member
    Join Date
    Feb 2005
    Location
    Central Florida
    Posts
    7

    Sound won't play when published

    I added the sound to the down frame of the button. I also tried to do a behavior earlier.

  4. #4
    Member
    Join Date
    Jan 2005
    Posts
    35
    did you embeded you sounds to your movie?
    Post no bills

  5. #5
    Junior Member
    Join Date
    Feb 2005
    Location
    Central Florida
    Posts
    7
    UUUUHHHH! No. Please educate me.

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Attach your .fla or a mockup one relicating the problem, zipped up and in a MX only format, not MX2004.

    You'd have a better chance of getting an answer if your .fla was in a MX only format, and zipped up.

    You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.

  7. #7
    Radarguy, I'm having quite the same problem with sound. First, a button answer or two, for you...hopefully. Do your buttons have interactive sound associated with them (ie. rollover, clickdown, etc.) or does the button itself direct the user to your sound file? If interactive sound is your interest, create the buttons through the INSERT menu, put the sound in one or more of the four button frames that define your button.

    The next scenario is my problem, and perhaps yours: I use buttons and actionscript to move around a portfolio of mine (think of a slideshow presentation). The script is on the main timeline. I defined a sound object, went into the library to link (aka LINKAGE) and named it, attached it to the button and it works great when checked. But online...no sound?? The button actionscrpt, which has been working fine for rollover, etc., is on the main timeline. I put the following sound code in the existing rollover statements:

    on (rollOver) {
    gotoAndStop("Scene 1", 5);
    mySound.start(0, 1);
    }
    on (rollOut) {
    gotoAndStop("Scene 1", 1);
    mySound.stop();
    }

    Where should the sound object funtion statement be located, with regard to layers and frames? (Radarguy, you might need this:

    mySound = new Sound();
    mySound.attachSound("bornusa");

    where mySound is any X or Y type variable assigned to your soundfile bornusa.)

    When attaching a sound, and linkinng w/in the library, it requests to be "exported to the first frame". The image associated with my rollover has to be in frame 5...Is this a problem? I can only export to the first frame though. Any insight is welcomed! Thanks.

    PE
    “Any fool can make things bigger, more complex, and more violent. It takes a touch of genius-and a lot of courage-to move in the opposite direction.” – Einstein

  8. #8
    Junior Member
    Join Date
    Feb 2005
    Location
    Central Florida
    Posts
    7
    To Oldnewbie:
    Let me preface this by saying that I am using MX2004.
    The first time I assembled the flash movie I could not even get the sound to work in the Ctrl+Enter preview until I noticed that the publish preference was set to Flash Player 6. As soon as I changed it to Flash Player 7 all worked with the Ctrl+Enter preview but still not the swf file. So I will try what you say just to give others the code but I doubt it working even as far as I have it.
    To Professor_emp:
    I have found that all the code that you can get in the first frame of the top layer(traditionally named actions or scripts) has the best chance of working since you are not putting the code in the Button Action.
    I have also had success using the behavior technique to play a sound but for some, probably simple, reason this page is obstinate. I will ad the zipped file when I get home tonight.
    Thanks all
    Russ

  9. #9
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    In the down frame of your button, select the sound, and in the properties panel, set the Sync to Event.
    Attached Files Attached Files

  10. #10
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    This;

    mySound = new Sound();
    mySound.attachSound("bornusa");

    Should look like this;

    mySound = new Sound(this);
    mySound.attachSound("bornusa");

    And it can go in frame 1 or right after the preloader. Then you can use the start line almost anywhere;

    on (rollOver) {
    gotoAndStop("Scene 1", 5);
    _root.mySound.start(0, 1);
    }

  11. #11
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Bad idea to ever target a scene name...

    gotoAndStop("Scene 1", 5);

  12. #12
    Junior Member
    Join Date
    Feb 2005
    Location
    Central Florida
    Posts
    7
    Well, guys as luck would have it, while I was paring down the the buttons and graphics to just one to reduce the file size, I thought I would test the swf file and lo and behold it worked and even when imported into Dreamweaver MX. I hate when this happens. Like when I would work on TVs just by taking the back off they would work and then continue to work for years and I never new what caused it to break in the first place. Now I don't know what I did wrong in the code. Oh, well I guess I will just start adding and testing a little bit at a time. Thanks for all the assistance. It did not go to waste.
    Russ

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