How Do I Use an External MP3 file Without Embedding it? (AS2)

I am using Adobe Flash CS6 with ActionScript 2.0.
I have compiled my project, and due the collection of embedded mp3 files (background music) I am using on various locations, my published swf file is over 12MB.
To reduce the size, I placed all the mp3 fiels in the same folder as the swf file and removed all reference to them from the project.
I then added this code to frame #1
import flash.events.Event;
import flash.media.Sound;
import flash.net.URLRequest;
var CreditsMusic:URLRequest = new URLRequest("NineWalkers.mp3");
var s:Sound = new Sound(CreditsMusic);
CreditsMusic.setVolume(50);
CreditsMusic.start(0,1);
Obviously, this is not working (I would not be posting here if it was).
What am I doing wrong?

I haven't look into the help documents (you can), but I see you mixing up AS2 and AS3 code, along with treating a URLRequest (AS3) as if it is a Sound object....
     CreditsMusic.setVolume(50);
     CreditsMusic.start(0,1);
If you want to work with the Sound class in AS2 open the help documents and see what properties and methods are available for the Sound class and work things out from there.  If you search Google using "AS2 Sound loadSound" you might get some good info as well.

Similar Messages

  • Using Flashvars to load external mp3 files

    I am trying to find a very good step by step tutorial on using "Flashvars" to load external mp3 files, I have been searching on google and the many I have found fall short in some way or another. From what I have been able to gather, I have tried using the code in red (commented out), which works, and modify it to use "Flashvars". The code that works, the mp3 file is hard coded, but my goal is to use "Flashvars" which I am attempting to do in the code following the code in red. I am also including the html code. Any help will be greatly appreciated.
    Thanks,
    David
    var soundReq:URLRequest = new URLRequest("mardi_gras2.mp3");
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    function onComplete(event:Event):void
        sound.play();
    var soundReq:URLRequest = new URLRequest(root.loaderInfo.parameters.audio);
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    function onComplete(event:Event):void
        sound.play();
    HTML CODE
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="mySoundvars" align="middle">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="false" />
        <param name="movie" value="mySoundvars.swf" />
       <param name="FlashVars" value="audio=mardi_gras2.mp3" />
        <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />    <embed src="mySoundvars.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="mySoundvars" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" FlashVars="audio=mardi_gras2.mp3" />

    Ok waterlovinguy,
    I went back to my original code, and I got things to work... I think my whole issue was with the HTML CODE. So I decided to use the "SWFObject generator". I had never used it before, frankly I had never heard of it until I started my searches on "Flashvars".
    Thank you very much for all your assistance, PEACE,
    David
    Final Codes below
    var my_var:String = new String();
    my_var = root.loaderInfo.parameters.myflashvar;
    myText.text = my_var;
    var soundReq:URLRequest = new URLRequest(root.loaderInfo.parameters.audio);
    var sound:Sound = new Sound();
    var soundControl:SoundChannel = new SoundChannel;
    sound.load(soundReq);
    play_btn.addEventListener(MouseEvent.CLICK, playSound);
    stop_btn.addEventListener(MouseEvent.CLICK, stopSound);
    function playSound(event:MouseEvent):void
        SoundMixer.stopAll();
        soundControl = sound.play();
    function stopSound(event:MouseEvent):void
        soundControl.stop();
    HTML Code
                    <!>>
                    <!<![endif]>
                        http://www.adobe.com/go/getflashplayer
                        </a>
                    <!>>
                    </object>
                    <!<![endif]>
                </object

  • Trouble with loading external mp3 files

    I apologize for the length of the post. I hope this is clear
    of what I am trying to explain.
    My problem deals with getting "undefined" when I press a
    button to load an external mp3 files. The following is what my XML
    childNode looks like:
    <option phonetic="Soundless, or A" name="aleph"
    cursive="alephCursive.swf" block="alephBlock.swf"
    audio="char1.mp3"/>
    Every attribute loads the way I've programmed them, except
    for the last one "audio".
    The following is what my actionscript looks like loading in
    these attributes:
    Everything is happening inside the onLoad event for my XML
    file.
    var xmlContent = this.firstChild.firstChild;
    audioContent = new Array();
    for (var i = 0;
    i<this.firstChild.firstChild.childNodes.length; i++) {
    nextEntry = xmlContent.childNodes
    audioContent = [nextEntry.attributes.phonetic,
    nextEntry.attributes.name, nextEntry.attributes.cursive,
    extEntry.attributes.block, nextEntry.attributes.audio];
    The code above simply adds each attribute to the audioContent
    array. Each element traces out correctly.
    The following code is how I am using these attributes:
    for (var i = 0; i<audioLength; i++) {
    audioContainer.attachMovie("container4", "audioItem"+i, i);
    // Create a shortcut reference to the present movie clip
    thisClip = audioContainer["audioItem"+i];
    thisClip.myTxt1.htmlText = audioContent[0];
    thisClip.myTxt2.htmlText = audioContent
    [1];
    thisClip.cursive_mc =
    loadThis(assetPath+audioContent[2], thisClip.cursive_mc);
    thisClip.block_mc = loadThis(assetPath+audioContent
    [3], thisClip.block_mc);
    thisClip.speaker_mc.attachMovie("speaker", "speaker_mc",
    this.getNextHighestDepth());
    thisClip.speaker_mc.speaker_mc.onRollOver = function() {
    this.nextFrame();
    thisClip.speaker_mc.speaker_mc.onRollOut = function() {
    this.prevFrame();
    thisClip.speaker_mc.speaker_mc.onRelease = function() {
    mySnd.loadSound(audioPath+audioContent[4],true);
    Loading the text works inside the htmlText. Using a function
    loadThis to load external swf files works corerctly and even
    attaching a linked movieclip from my library called "speaker" works
    correctly.
    The problem comes from pressing the speaker movieclip that
    the output traces "undefined" instead of the external mp3 file.
    I appreciate any help. Thanks.

    As Ned said the problem might be with the file structure on the server. Other problems may be with spelling. You computer may not be case sensitive to the names of the .swf files that you are loading, but your server might. So, on your computer when you are testing, second.swf is the same as Second.swf, or even second.SWF. But, on the server each of these variations is seen as a different file. Another problem is that when you are loading files from the same computer in testing, those files are close and so they load very quickly from your computer. When the files have to travel from the server, there will likely be a measurable period of time before the file is ready to be shown. This is particularly problematic with video that is embedded into an .swf. The whole file will need to be downloaded and uncompressed before it is available to play. If you stream the video as an external file, you can shorten the wait considerably.

  • External MP3 files not working

    Hi,
    I have attached code straight out of the help file for using
    External MP3 files. It works perfect when I use their HelpExample
    sound MP3 file. However when I simply change the code to point to a
    working MP3 sound file in my LocalHost folder it executes but I
    only get a Blip sound.
    If I just double click on the sound file it sounds ok. and I
    have been successful in using these MP3 files embedded in Flash 8.0
    fla file
    Do the external MP3 files have to be on some special server?
    I am using this code with Flash 8.0
    Thanks,
    hugh

    The most likely reason for this failure is that since your SWF is now embedded into another SWF (the Captivate project) the paths to the AS files need to be altered in Flash to allow for this.
    You need to investigate how this would be done in AS code if your Flash SWF was a symbol inside another Flash SWF.

  • How do I use an external hard drive with iMovie 10.0.1? I have run out of disk space on my Macbook Air.

    How do I use an external drive with iMovie 10.0.1?  It is not obvious and I have run out of space.

    If you want to move a complete iMovie 10 library (file with .imovielibrary extension) click on the library in the libraries pane and select  File - Consolidate Library Media.  This ensures that all media is copied to the library.  You can then move the library onto your external drive using Finder.  The first time to want to access it from iMovie you will have to tell it where it is by choosing  File - Open Library -Other and navigating to it.
    If you only want to transfer part of a library to another drive, create a new library a at the desired location  File - Open Library - New  and copy projects and events to it from within iMovie.
    Its all described in iMovie help - "Work with multiple libraries".
    Geoff.

  • How Do I use my External Drive for my iTunes Library without adding anything to my Mac's HD?

    I have a new MBP and have transferred all of my music off my old pc (250+ gigs) to a Lacie 1TB thunderbolt external drive.  How do I use the external as my primary itunes library with out using any of my Mac's HD?  I'm new to mac so I have a few more questions...
    1. The initial question above
    2. will this work or will there be extra steps every time I disconnect and connect the external (other than ejecting)?
    3. Will I be able to access it remotely / home sharing?
    4.  Would this work with itunes match?
    Thanks All  !!!

    DevonC wrote:
    I haven't set up Time Machine yet because it wants me to completely format my external hard drive, and it seems to want to use it for TM backups exclusively?
    However, I would also like to use it to store stuff that I don't want to keep on my computer, eg tons of photos, videos, stuff from my sister's computer, etc.
    Is there a way to do Time Machine but also use the external hard drive for storage? I don't mind temporarily copying the photos etc that are on there to my computer while I format, so that's not the issue. I just don't want my EHD rendered completely useless to everything else.
    Thanks!!!
    There are several ways to do exactly this.
    If you partition the external drive, you can use one partition for TM and the other for anything else.
    Even if you do not partition the drive, you can safely store other data in folders on the drive. Just to not use the folder that TM creates for anything. And it's best not to put files directly on the drive, in my opinion, but use folders for storage.
    Just remember that whatever you put on the drive takes up room from TM and when the drive gets nearly full, TM will start automatically deleting older files from it's own folder.
    I have my Tiger clone on my external TM drive in a separate partition and everything works fine.

  • How can I use an old XMP file on a new set of images??

    I have an older XMP file that contains settings used to retouch some previous images in a particular way. I'd like to apply those same settings to a new set of images. How can I use that older XMP file on a new set of images in Lightroom?
    The contents of the XMP file are as follows:
    <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2-c020 1.124078, Tue Sep 11 2007 23:21:40   
    ">
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
    xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">
       <crs:Version>6.0</crs:Version>
       <crs:ProcessVersion>5.7</crs:ProcessVersion>
       <crs:WhiteBalance>Custom</crs:WhiteBalance>
       <crs:Temperature>4700</crs:Temperature>
       <crs:Tint>+4</crs:Tint>
       <crs:Exposure>-0.35</crs:Exposure>
       <crs:Shadows>5</crs:Shadows>
       <crs:Brightness>+50</crs:Brightness>
       <crs:Contrast>+25</crs:Contrast>
       <crs:Saturation>-8</crs:Saturation>
       <crs:Sharpness>25</crs:Sharpness>
       <crs:LuminanceSmoothing>0</crs:LuminanceSmoothing>
       <crs:ColorNoiseReduction>25</crs:ColorNoiseReduction>
       <crs:ChromaticAberrationR>0</crs:ChromaticAberrationR>
       <crs:ChromaticAberrationB>0</crs:ChromaticAberrationB>
       <crs:VignetteAmount>0</crs:VignetteAmount>
       <crs:ShadowTint>-1</crs:ShadowTint>
       <crs:RedHue>0</crs:RedHue>
       <crs:RedSaturation>0</crs:RedSaturation>
       <crs:GreenHue>0</crs:GreenHue>
       <crs:GreenSaturation>0</crs:GreenSaturation>
       <crs:BlueHue>0</crs:BlueHue>
       <crs:BlueSaturation>0</crs:BlueSaturation>
       <crs:FillLight>0</crs:FillLight>
       <crs:Vibrance>+5</crs:Vibrance>
       <crs:HighlightRecovery>24</crs:HighlightRecovery>
       <crs:Clarity>+8</crs:Clarity>
       <crs:Defringe>0</crs:Defringe>
       <crs:HueAdjustmentRed>0</crs:HueAdjustmentRed>
       <crs:HueAdjustmentOrange>0</crs:HueAdjustmentOrange>
       <crs:HueAdjustmentYellow>0</crs:HueAdjustmentYellow>
       <crs:HueAdjustmentGreen>0</crs:HueAdjustmentGreen>
       <crs:HueAdjustmentAqua>0</crs:HueAdjustmentAqua>
       <crs:HueAdjustmentBlue>0</crs:HueAdjustmentBlue>
       <crs:HueAdjustmentPurple>0</crs:HueAdjustmentPurple>
       <crs:HueAdjustmentMagenta>0</crs:HueAdjustmentMagenta>
       <crs:SaturationAdjustmentRed>0</crs:SaturationAdjustmentRed>
       <crs:SaturationAdjustmentOrange>0</crs:SaturationAdjustmentOrange>
       <crs:SaturationAdjustmentYellow>0</crs:SaturationAdjustmentYellow>
       <crs:SaturationAdjustmentGreen>0</crs:SaturationAdjustmentGreen>
       <crs:SaturationAdjustmentAqua>0</crs:SaturationAdjustmentAqua>
       <crs:SaturationAdjustmentBlue>0</crs:SaturationAdjustmentBlue>
       <crs:SaturationAdjustmentPurple>0</crs:SaturationAdjustmentPurple>
       <crs:SaturationAdjustmentMagenta>0</crs:SaturationAdjustmentMagenta>
       <crs:LuminanceAdjustmentRed>0</crs:LuminanceAdjustmentRed>
       <crs:LuminanceAdjustmentOrange>0</crs:LuminanceAdjustmentOrange>
       <crs:LuminanceAdjustmentYellow>0</crs:LuminanceAdjustmentYellow>
       <crs:LuminanceAdjustmentGreen>0</crs:LuminanceAdjustmentGreen>
       <crs:LuminanceAdjustmentAqua>0</crs:LuminanceAdjustmentAqua>
       <crs:LuminanceAdjustmentBlue>0</crs:LuminanceAdjustmentBlue>
       <crs:LuminanceAdjustmentPurple>0</crs:LuminanceAdjustmentPurple>
       <crs:LuminanceAdjustmentMagenta>0</crs:LuminanceAdjustmentMagenta>
       <crs:SplitToningShadowHue>138</crs:SplitToningShadowHue>
       <crs:SplitToningShadowSaturation>13</crs:SplitToningShadowSaturation>
       <crs:SplitToningHighlightHue>0</crs:SplitToningHighlightHue>
       <crs:SplitToningHighlightSaturation>0</crs:SplitToningHighlightSaturation>
       <crs:SplitToningBalance>0</crs:SplitToningBalance>
       <crs:ParametricShadows>0</crs:ParametricShadows>
       <crs:ParametricDarks>0</crs:ParametricDarks>
       <crs:ParametricLights>0</crs:ParametricLights>
       <crs:ParametricHighlights>0</crs:ParametricHighlights>
       <crs:ParametricShadowSplit>25</crs:ParametricShadowSplit>
       <crs:ParametricMidtoneSplit>50</crs:ParametricMidtoneSplit>
       <crs:ParametricHighlightSplit>75</crs:ParametricHighlightSplit>
       <crs:SharpenRadius>+1.0</crs:SharpenRadius>
       <crs:SharpenDetail>25</crs:SharpenDetail>
       <crs:SharpenEdgeMasking>0</crs:SharpenEdgeMasking>
       <crs:PostCropVignetteAmount>0</crs:PostCropVignetteAmount>
       <crs:GrainAmount>0</crs:GrainAmount>
       <crs:ColorNoiseReductionDetail>50</crs:ColorNoiseReductionDetail>
       <crs:ConvertToGrayscale>False</crs:ConvertToGrayscale>
       <crs:ToneCurveName>Medium Contrast</crs:ToneCurveName>
       <crs:ToneCurve>
    <rdf:Seq>
    <rdf:li>0, 0</rdf:li>
    <rdf:li>32, 22</rdf:li>
    <rdf:li>64, 56</rdf:li>
    <rdf:li>128, 128</rdf:li>
    <rdf:li>192, 196</rdf:li>
    <rdf:li>255, 255</rdf:li>
    </rdf:Seq>
       </crs:ToneCurve>
       <crs:CameraProfile>Adobe Standard</crs:CameraProfile>
       <crs:CameraProfileDigest>3DA8CE4A626CE36A1D0C55BF157793C9</crs:CameraProfileDigest>
       <crs:HasSettings>True</crs:HasSettings>
      </rdf:Description>
    </rdf:RDF>
    </x:xmpmeta>

    I’m pretty sure Adobe NEVER intended for someone to copy an XMP file from one photo to another outside of LR as a way to replicate settings.   You can make a preset from a photo, as discussed, or if you don’t want to do that, copy-paste the settings from a representative photo that you initially select to one or more new photos.  You could have a special LR folder that holds standard photos to copy/paste from.  Of course creating a Develop preset from the representative photo is the “normal” way to handle such situations, but maybe you have hundreds of different situations to copy settings from and don’t want to create presets for each one, but I’d argue that you could create a complex folder hierarchy for your presets and still have them findable without that much problem.
    As far as the mystery about why some photos show Reset and some show From Metadata, is the Process Version (down in Camera Calibration) of the photo before reading the settings the same between the two situations?  And in general, are these virgin photos newly imported into LR or have some been modified in LR, already?  Does an XMP file already exist for any of these, where that XMP is being overwritten by your external-to-LR copying?  Or do you have auto-write-XMP enabled and your hand-copied XMP is getting overwritten by LR, automatically, before you have a chance to read in anything?

  • How do I deploy an external JAR file

    Hello,
    How do I deploy an external JAR file?
    I am grateful for every hint.

    Hi Manuel,
      If you read my blog mentioned in the beginning of the thread, you will note that such solution is not supported in our engine due to number of reasons.
      Please, read the blog and use application library shared among these two applications. You will achieve the same effect. Please note that the using application will need run and deploy-time dependencies to the shared library.
      You should not add files to any of the folders manually or manipulate engine's classpath in such situations.
    Best Regards,
    Georgi

  • How do i use an external display with my macbook pro?

    How do I use an external display with a macbook pro?

    Just buy the proper adapter cord, such as MiniDisplay port to HDMI for example.  Plug it in and it will be automatically recognized.  Use System Preferences > Displays to set options.
    The display can Mirror your primary desktop or Extend the Desktop.
    Regards,
    Captfred

  • How Do I Use DVD Studio Pro Files In iDVD?

    I had somebody create a DVD for me using DVD Studio Pro. (This was a compilation of many different videos.) It turned out great.
    I now want to make a DVD of one of those videos on my own using iDVD '08.
    I have the raw video/audio files. But, my problem is the raw files that were used for the DVD Studio Pro project are separated into one video file and one audio file. I don't know how I can get them both into iDVD. I was told that I have to recombine these two files into one file. But, how do I do this and still maintain the best quality?
    (I am not a video expert by any means, but I can tell you that the video file is a ".mpeg" and the audio file is an ".ac3". When looking at the .mpeg file in the finder it lists its Kind as "MPEG Movie" and when looking at the .ac3 file in the finder it lists its Kind as "Unix Executable File".)
    (I'm using iDVD 7.0.1 - I do have Quicktime Pro - I do not have the Quicktime MPEG-2 Playback component - I do not have DVD Studio Pro)
    Thanks in advance for your help!

    Q: How Do I Use DVD Studio Pro Files In iDVD?
    A: You don't, essentially.
    DVDSP is apple's top end app and it is intended to be used with FCP > Compressor > DVDSP. All of these are pro apps.
    i-Apps are consumer apps all of which are QT based. With that in mind ....
    now that doesn't mean you can't use FCP > iDvd. You can. But you have to do it in a way that iDvd will read all the files (meaning you must think in terms of QuickTime and export in this way). So when you export your QT File / Movie from FCP over to iDvd, it will look something like this hopefully regardless of the raw image & audio files you have already compiled which unfortunately will NOT work with i-Apps BUT will work with apple's pro apps which is the intended workflow / direction of said files in the first place.
    Btw ... if your QT movie has chapter markers then please use the following settings so iDvd can read these markers. (if on the other hand you were looking to export this file to DVDSP; then you would choose DVDSP Markers.
    Let me know if the above helps. If not, just come on back.

  • How do i use an external hard drive for all my itunes music?

    how do i use an external hard drive for all my itunes music?

    Hi valleydave,
    Here are two good links for you to check out:
    http://support.apple.com/kb/ht1751
    http://support.apple.com/kb/ht1449
    The first one goes over, in-depth, what you're looking for in regards to "off site" iTunes.

  • How can I use my external hard drive for my iphoto instead of my mac book pro memory?

    i don't know if this question has been asked before: how can I use my external hard drive for my iphoto instead of my mac book pro memory? just like itunes all my song are save on my external hard drive. make sense?

    Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
    And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
    And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
    LN

  • How do I convert an audio mp3 file to a text file?

    How do I convert an audio mp3 file to a text file?

    StephenInAZ wrote:
    I keep responding to posters here but my responses dissapear.
    there were reasons for that, see:
    https://discussions.apple.com/static/apple/tutorial/tou.html

  • Is there a way I can use my external hard drive without the files being transferred on to my computer? as like like my iTunes music being on my hard drive without them being copied onto my computers hard drive ?

    is there a way I can use my external hard drive without the files being transferred on to my computer? as like like my iTunes music being on my hard drive without them being copied onto my computers hard drive ? because i dont have that much memory and i wanted my external hard drive to be the source for my music files and not my computer.

    Many users keep their iTunes libraries on external drives. You just have to remember to connect and power up the drive before launching iTunes.
    iTunes for Mac: Moving your iTunes Media folder:
      http://support.apple.com/kb/HT1449 

  • To test how can we use the opt  'logical file name' to name the file based

    Hi Sir/Madam,
               to test how can we use the opt  'logical file name' to name the file based on the selection made in the dtp run for extracting data as flat file.

    Hi Vishali,
    In the DTP select the file location as application server and give the logical file path. The actual file and logical path can be created using transaction "FILE" and "AL11".
    Rest of the process is same as that of extraction from local file.
    Regards,
    Durgesh.

Maybe you are looking for

  • How do I update my iPad to iOS, How do I update my iPad to iOS

    How do I update my iPad to iOS

  • IPod Video 30gb volume indicator blank

    The blue bar that indicates volume on my iPod is not there. When I adjust the volume it works fine as in the volume gets louder or quieter but there is no blue bit to indicate the volume level. Will a restore fix this or is it faulty? Ta x

  • Itunes Newest Version no Photo Tabs

    So I downloaded the latest version of Itunes and I tried to sync my photos to my ipod and the tab for Photos isn't even there.  I look in preferences for the sources and it wasnt even in there. I can not find the option to add photos or sync or anyth

  • TOC indenting a heading that shouldn't be indented

    Hi, Gang! I've created a TOC for a book and the TOC entries for the two divider pages are indenting when they should not be. The TOC style for the divider page heading has no indentation and the entry on the TOC reference page looks correct. To make

  • Add an option to replace the current slideshow content

    Currently, the content of a slideshow is only replaced when going straight from the sample images. Would it be possible to add a checkbox to force the new content to replace the current images, rather than append them? This would be really helpful wh