|
|
# 1 | ||
|
Member
Join Date: Jun 2006
Location: Gainesville, FL
Posts: 12
|
No Audio in SWF
I have an interactive SWF inserted in a AP that uses the sound property. In the SWF itself, the audio is attached like this:
Code:
var voiceOver:Sound = new Sound();
voiceOver.attachSound("step1.mp3");
voiceOver.start();
|
||
|
|
|
|
# 2 | ||
|
Member
Join Date: Mar 2006
Location: Silver Spring, MD
Posts: 1,444
|
I don't know exactly how all of your code is working in the file, but this is how I attach and start audio files in MX 2004:
voiceOver = new Sound(this); this.voiceOver.attachSound("step1.mp3"); voiceOver.start(); If you need additional info, I would check out Adobe's Flash Forum, which I have found to be very helpful when learning the programming aspects of Flash. HTH, Phil |
||
|
|
|
|
# 3 | ||
|
Member
Join Date: Jun 2006
Location: Gainesville, FL
Posts: 12
|
i was wondering if attaching to audio to a specific object would make a difference or not. I'll have to give it a try.
like i said, it works fine as a SWF file in a browser, just not in the AP. |
||
|
|
|
|
# 4 | ||
|
Member
Join Date: Mar 2006
Location: Springfield, OH
Posts: 1,603
|
Due to the fact that you are using relative links in Flash for your .mp3 files, it could also be the location of the .mp3 file in relationship to the .swf file after publishing. The .swf file could be working correctly but just can't find the .mp3.
The .mp3 file needs to be relative to the player.html file in your published files for the .swf to find the .mp3. For example, in your case, you would want to make sure to physically place the step1.mp3 file in the same folder as player.html, after you publish from AP.
__________________
Brian |
||
|
|
|
|
# 5 | ||
|
Member
Join Date: Mar 2006
Location: Silver Spring, MD
Posts: 1,444
|
That is very true if the MP3 is outside the file...but the attachSound function is intended for sounds inside the Flash file's library (if that is what he's trying to do).
Phil |
||
|
|
|
|
# 6 | ||
|
Member
Join Date: Jun 2006
Location: Gainesville, FL
Posts: 12
|
yes, the audio files are in the library and marked for export to actionscript.
Adding this to the sound object worked! there was no need to include the this to the attachSound command. Having it in the variable declaration was enough. Thanks! |
||
|
|
|
|
# 7 | ||
|
Member
Join Date: Mar 2006
Location: Silver Spring, MD
Posts: 1,444
|
Glad to hear it worked. What you experienced is a quirk in Flash where embedded audio files do not work on a local level. This should work on both a local and web level.
BTW, you are right...the extra "this" is normally not necessary (but doesn't hurt)...but once in a blue moon, I need it. Phil Last edited by Spectre : 06-14-2006 at 04:00 PM. |
||
|
|
|
|
# 8 | ||
|
Member
Join Date: Mar 2006
Location: Springfield, OH
Posts: 1,603
|
Quote:
I'm glad that did the trick, though!
__________________
Brian |
||
|
|