Sound Object Problem

Hi All,
I'm working with sound object. I want to pause the sound. By
clicking on pause btn, I'm storing the sound position in a variable
e.g:
_root.soundPos = _root.mySound.position;
but when I click the play btn, sound is not playing, I have
written following code on play btn :-
_root.mySound.start(_root.soundPos,99999);
If I write following code, sound starts to play but not from
the given position, it starts from 0 .
_root.mySound.start(eval(_root.soundPos),99999);
Plz. help me and let me know where I'm doing wrong.
Thanks
Harmeet

you moved your embedding html's location or you move your
mp3's location.

Similar Messages

  • How to flush the loaded bytes of a Sound object

    Hi all,
    I've now been looking for a solution to my problem for quite
    a while now, but so far without any success, so I thought I'll give
    this forum a try.. maybe someone in here can help ;-)
    Ok here's the deal: I'm trying to create a simple audio
    player in flex that is able to play mp3 audio streams. I'm not
    looking for a solution that works with an FMS (Flash Mediaserver)
    and I do also not need code that shows me how to play a remote mp3
    file (which of course is also some sort of streaming streaming). I
    have an icecast internet radio server which is streaming a constant
    flow of mp3 encoded data. I can connect to that stream with
    standard media players like winamp or mplayer.
    I've been playing around with the
    URLRequest-SoundLoaderContext-Sound-SoundChannel-combo and tried
    many different combinations, but somehow the Sound object won't let
    go of the bytes it already played. The Sound.bytesLoaded will just
    keep increasing and my memory will just keep being eaten by the
    Flashplayer. Is there any way to free that memory again without
    having to destroy the Sound object? Or if I have to destroy it, how
    do I make sure that the user doesn't realize that I just switched
    the old Sound object with a fresh and empty one?
    I was also trying to get a NetConnection-NetStream-combo to
    play my stream, but here I failed even sooner: Even though the
    NetStream seems to be receiving the data from my server (Firefox
    states that it is receiving data after I invoke
    NetStream.play(url_to_stream)) I'm not able to get that data to
    come out of my speakers. I just can't hear anything :-(
    I'm pretty new to flex, as and flash, so please forgive me my
    ignorance ;) I really tried to figure this one out for about 3 days
    now..
    I'd be very grateful for any hints or advice :-)
    cheers,
    Lorenz
    Edit: oh yeah right: I don't know if this is too obvious, but
    I'm using flex3 :-)

    kurusaki wrote:
    i need to get the serial number of a X509Certificate
    the getSerialNumber() methode of X509Certificat return an BigInteger then can see in (windows application) or in the debuger of eclipse that the serial number is coded in HEXA
    how i can getting it in HEXA.
    If you look at the Javadoc for BigInteger you will see a toString() method that allows one to specify the radix. Hex is just radix 16.

  • How remove box showing up around sound object

    hi all - can anyone please tell me how to remove the white box that "houses" my sound object:
    http://www.gratefulcreative.com/portfolio.html
    Thanks one million!
    ken d
    creative director
    grateful creative
    www.gratefulcreative.com

    Hi Larry,
    I didn't think that was a default setting for a spreadsheet built within a table, but apparently it is.
    I'm guessing your experience is similar to mine when I first tried out Numbers after years with Excel. I just didn't get it. It was only after I realized the advantages of working with discrete tables (as opposed to Excel's one big sheet) that things got easier, much easier.
    it looks like with so many people complaining they're starting to add features back in. 
    None of us are privy to what is going on within Apple, of course, but just a general knowledge of the complexities of software engineering and the typical lead times suggests that the major features added back in had to have been planned quite some time ago. It seems more are likely in the works.
    Unfortunately, if you have to work with folks who use Office (on Windows) it's still not a great option.
    This depends on what your work involves. I've had few problems in a Window-centric office. In general, if you have to do a lot of printing of precisely formatted documents, Numbers 3 in its current form is not a great choice.
    But if you're interested in collaborating, the iCloud sharing has gotten pretty decent (in some ways better than the MS offering). Anyone on any OS with a modern browser can take advantage of that.
    And if you want to do data entry in the field on a popular mobile device and have it sync automatically back to a computer, Numbers currently has a big leg up on the competition.
    SG

  • Preloader and Sound Object

    My Flash site has a media player which uses the attachSound
    method to play and skip through 3 mp3s. As a result the preloader
    shows up after the movie has loaded 60%. To rectify this, i changed
    the Publish Settings under the Flash Tab so that the classes for AS
    2.0 load in the 2nd frame of the Preloader Scene(I have separated
    the preloader and the main movie to diffrerent scenes..)
    I read it somewhere that to correct a similar problem with
    MCs, you need to place them somewhere in the timeline (say,Off
    Stage), But how can same be done for Sound Objects.???

    if i do that then the preloader works fine,however the player
    doesnt work...since the audio files dont get loaded..

  • (MX04) Pausing a loaded swf with sound objects within it

    Hi,
    I'm working on a PowerPoint-esque presentation where a user
    watches and listens to a loaded swf in the main movie, clicks the
    next button (which unloads the swf, advances to the next frame and
    loads the next swf), and watches the next one. Lather, rinse,
    repeat. Some of the sections are rather long, and I'd like to give
    the user the ability to pause and play by button click.
    I know how to stop and start the container MC, but that
    doesn't stop the sound object (and the embedded MCs). I also know
    how to pause and start a sound object using the object's instance
    name. Is there a way to pause everything from the main timeline,
    and keep the AS general enough so that any sound object pauses when
    clicked?
    Any help is most appreciated! MX04 and AS2.0.
    Thanks!

    Kglad,
    I tried your code and ran into some problems with stopping
    the mc's, as the embedded mc's within the loaded swf need to stop
    as well. I found the attached code to stop the mc's, but now am
    having trouble with the sound objects.
    Here's the issue, I used this:
    this.soundPosition = currentMovie.loop1.position/1000;
    this.currentMovie.loop1.stop();
    ... for the sound object stop commands and listed a new one
    for each loop I was using. On the play button I started them back
    up again. This all works, but when I start them up again they all
    play, not just the one that is currently paused. Do you mind giving
    me some guidance with the for (obj in mc) loop? My loop experience
    is nil. What I want to do is have the code cycle through all of the
    loops to see which one is playing, then store that information in a
    variable, then pause and play the variable. Does that sound right?
    Thanks again for the help!
    -Sandy

  • How to close the Sound object

    I'm using Flash CS3, running code in ActionScript 3.
    I use the Loader class to load a child SWF file, which then
    takes over the entire area on my website that is reserved for
    Flash. If the user decides to stop watching the SWF file before it
    is completed, he hits the "close" button within the child SWF,
    ultimately causing the Loader.unload() method to be executed. So
    far, so good, only the sound from the remaining portion of the SWF
    file keeps playing. According to the Flash Docs for the
    Loader.unload() method:
    "As a best practice, before you unload a child SWF file, you
    should explicitly close any streams in the child SWF file's
    objects, such as LocalConnection, NetConnection, NetStream, and
    Sound objects. Otherwise, audio in the child SWF file might
    continue to play, even though the child SWF file was unloaded."
    It then gives an example that assumes you already have access
    to the Sound object, so closing the Sound object is done by:
    mySound.close();
    The only problem is that I have no idea how to access the
    Sound object when I use the Loader.load() method. Where is this
    beast? I can't seem to find anything in the documentation that
    tells me how to find the Sound object after calling Loader.load().
    As a temporary fix, I modified the target SWF file so that when the
    "close" button is hit, it calls the "stop()" function; however,
    this only stops the sound, it does not close the associated Sound
    object, and I presume it continues to lurk around in memory with
    nothing useful to do. (When the user hits the "close" button in the
    child SWF file, it creates a "bubbling" event so that the Loader
    class can call the Loader.unload() method on it.)
    I've attached code for your reference.
    Any help is deeply appreciated!
    -Dan

    Ack! Looks like I hijacked this thread, sorry.
    I'm doing almost exactly the same thing the OP is doing...
    Loader class to load an external SWF (which is a video file FLV).
    If the user hits the "close" button on the video, the video goes
    away as it should but the audio continues.
    I understand that I need to close any NetConnection and
    NetStream objects in addition to unloading the movie. What I don't
    understand is how to do that. I'm sure that it's a syntax thing I'm
    just not getting right. I would just really like a more detailed
    explanation of stopping NetConnections and NetStreams (but an
    explanation for the not-so-actionscript-experienced LOL).
    Thanks.

  • AIR 2.7.1: Help with sound stuttering problem in IOS!

    Hi all,
    I need to play audio in the background but unfortunately, it came out unstable:
    - On the 1st run after installing, it'll play fine until it loops, that's when the audio goes out completely.
    - On subsequent runs, the audio plays and loops but it stutters.
    I have scoured the forums and googled but couldn't find much advice other than the audio settings to use:
    - MP3 Compression
    - 128 kbps Bit Rate
    - 44.1 kHz sample rate
    The audio file is in the library and I call it up with the Sound object.
    Some additional info, I wrote a custom script to loop my sound:
    - I have 2 SoundChannels
    - I use a Timer to track the audio progress
    - When the 1st channel is almost up, I  play the 2nd channel; the 'old' channel fades out and stops while the 'new' channel plays and fades in
    I'm not sure what else I need to look for but any pointers will be great!
    Thanks!

    @pixelshocks,
    This is strange. I am not able to reproduce the stuttering on the app you shared with the bug, https://bugbase.adobe.com/index.cfm?event=bug&id=2988720, using the AIR 3.
    I tried playing audio continuously in foreground, and then after bringing it back up from background. In both the cases, the stuttering doesn't happen anymore. Can you please list the steps to reproduce the problem?
    @saariko
    For AIR on iOS, you need to download the Windows/Mac sdk. There is no separate runtime installer on iOS.

  • Sync two sound object

    Hi to all!
    I have a little question about play sound in Flex (with AIR).
    I create two Sound Object and load two mp3 file. Now i want that this two file start playing at the same time, when user click a button.
    The problem is that two file, when playing are a little lag (delay of about 1/2 second or less)...
    Where is the problem? Is an actionscript bug or is my interpretation of the sound class incorrect?
    This is my simplified code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
    <mx:Script>
         <![CDATA[
              public var sound1:Sound;
              public var sound2:Sound;
              public function  init():void
                   var path:String = "C:\\Documents and Settings\\myuser\\Documenti\\song\\";
                   var request1:URLRequest = new URLRequest(path + "file1.mp3");
                   var request2:URLRequest = new URLRequest(path + "file2.mp3");
                   sound1 = new Sound(request1);
                   sound2 = new Sound(request2);
              public function StartSong():void
                   sound1.play(0.0, 0.0, null);
                   sound2.play(0.0, 0.0, null);
         ]]>
    </mx:Script>     
         <mx:Button id="Start" x="113" y="101" label="Button" click="StartSong()"/>
    </mx:WindowedApplication>
    Thanks to all in advance.
    Regards.
    Luca

    I used thse mp3 files:
    http://muzakdeezign.com/air/funk_drums.mp3
    http://muzakdeezign.com/air/funk_bass.mp3
    For your test you use Mp3 file with particular encoding? I try with many mp3 and all havea sync problem.
    I used MediaCoder to encode from wav to mp3
    http://mediacoder.sourceforge.net/
    But from what I can tell (and have read), it doesn't matter which encoder you use.
    here's the code I used:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="appInit()">
    <mx:Script>
      <![CDATA[
       private var sound1:Sound;
       private var sound2:Sound;
       // appInit()
       private function  appInit():void {
        trace("Application ::: appInit");
        var request1:URLRequest = new URLRequest("loops/funk_drums.mp3");
        var request2:URLRequest = new URLRequest("loops/funk_bass.mp3");
        //var request3:URLRequest = new URLRequest(path + "G.mp3");
        sound1 = new Sound(request1);
        sound2 = new Sound(request2);
       // startSong()
       private function startSong():void {
        trace("Application ::: soundCompleteHandler");
        sound1.play(0, 0, null);
        sound2.play(0, 0, null);
       ]]>
    </mx:Script>
    <mx:Button id="Start" x="113" y="101" label="Button" click="startSong()"/>
    </mx:WindowedApplication>

  • Flash::media::Sound pthread problem

    When i start these two thread together the application freeze.
    Each thread on its own works !
    #include <pthread.h>
    #include <Flash++.h>
    using namespace AS3::ui;
    pthread_t audiothread;
    pthread_t tickThread;
    static var sampleDataEventListener(void *arg, var as3Args)
        flash::events::SampleDataEvent event = var(as3Args[0]);
        flash::utils::ByteArray data = event->data;
        printf("info: sampleDataEventListener write zero---\n");
         for ( unsigned int c = 0; c < 8192; c++ )
            data->writeFloat(0.0f);
        return internal::_undefined;
    static void *sampleDataThreadProc(void *arg)
        printf("Create sound object\n");
        flash::media::Sound sound = flash::media::Sound::_new(internal::_null, internal::_null);
        sound->addEventListener(flash::events::SampleDataEvent::SAMPLE_DATA, Function::_new(sampleDataEventListener, NULL), false, 0, false);
        sound->play(0, 0, internal::_null);
        AS3_GoAsync();
        printf("Error: GoAsync returned!\n");
        return NULL;
    ** Tick thread
    void *tickThreadProc(void *colorArg) {
        printf("TickThread start\n");
        int i = 0;
        while(i < 20)
            usleep(80*1000);
            printf("tick\n");
            i++;
        printf("TickThread done!!\n");
        return NULL;
    ** main method
    int main()
        printf("init console\n");
        pthread_create(&audiothread, NULL, sampleDataThreadProc, NULL);
        pthread_create(&tickThread, NULL, tickThreadProc, NULL);
        AS3_GoAsync();
        return 0;
    The application freeze with the output:
    init console
    Create sound object
    TickThread start
    tick
    tick
    tick
    My build call is:
    "$(FLASCC)/usr/bin/g++" $(BASE_CFLAGS) flash++ui.cpp -lAS3++ -lFlash++ -symbol-abc=Console.abc -pthread -O1 -swf-size=500x500 -emit-swf -o flashui.swf
    My console.as can be found here:  http://pastebin.com/ngkbcdYC
    I tried to init the console in both ways (CModule.startAsync(this) and CModule.startBackground(this, new <String>[], new <String>[]))  which doesn't make a diffrence.
    I also tried to set the -swf-version=18 parameter, but it doesn't make a difference, too.
    Anyone has an idea what is wrong ?
    Thanks !

    It may be that the calls to printf() are causing the problem. The printf() function may or may not be thread-safe or reentrant, depending on the system. Perhaps you might enable printf in only one of the threads, run it, and then enable it only in the other thread, and see what happens (easy test to make). If you are more ambitious, you could wrap the printf calls in a mutex. Generally, some folks recommend doing an explicit flush...

  • Sound Object misbehaviour

    hi,
    I am making some training modules in flash. The modules are
    spaned from 300-1000 seconds.
    When I play the module it plays in sych with the animation
    but as we proceed the sound starts leading the animation. And this
    diffrence keep on incresing. I have tested both stream and event
    sound. I tried to make smaller sound units but still it doesnot
    The event cannot be implemented since this presentation is
    simulation need to be paused sometimes.
    I am playing this in a engine which organizes such more
    files.
    One more issue is that when i pause the simulation for a long
    time say 10-15 mins then this difference is quite large.
    please help me.

    kglad wrote:
    > open_1 = new Sound(this);
    This way the _root is used. In the case of using more than
    one Sound
    Object can have problems. eg. when attributing a new value to
    the volume
    of an object, all the other Sound Objects will receive the
    new value.
    To use a movieclip for each object is the most correct.
    this.createEmptyMovieClip("objOpenSound",
    this.getNextHighestDepth());
    open_1 = new Sound(objOpenSound);
    open_1.attachSound("open_1");
    this.open_1.start(0, 1);
    Erick Souza
    www.ericksouza.com

  • Stream to Sound object

    Hi,
    I have the below snippet
    stream = new NetStream(netConnection);
    stream.client = this;
    stream.play("FILE_NAME");
    which basically plays a stream located on my Flash Media
    Server.
    Instead of playing the flv file with the stream object, I
    want to make use of the Sound object , sth. like
    var request:URLRequest = new URLRequest(url);
    var s:Sound = new Sound();
    s.load(request);
    How can I achieve this, any snippets

    You'd have to use an RTMP address, which the Sound object
    can't get to. I'm not sure if this is because of encoding problems
    or simple because rtmp can't be accessed that way. Also, a lot of
    the functionality of the SoundChannel object is lost (like any
    attempt at visualization) when streaming through FMS.
    I like how the LiveDocs list explicitly "stream through FMS"
    as one of the options for the Sound object, but offer no
    explanation of how to do so.

  • How do I know when a file loaded into a Sound object is invalid?

    I'm writing an app that allows the user to play various sound files.
    Some of these files are mp3, but some may also be ogg, wma, etc.  The selection is out of my control, so I need the sound API to tell me if it can't play something.
    To test, I loaded some test files into a sound object like so:
                    var urlRequest:URLRequest = new URLRequest("http://support.microsoft.com/support/MediaPlayer/wmptest/samples/new/mediaexample.wma");
                    var sound:Sound = new Sound();
                    var soundChannel:SoundChannel = sound.play();
    Even though Flex doesn't play wma's there is no error information or null objects anywhere.  Everthings seems to be fine to flex, I can even register for progress events and see the wma being loaded.
    Just to see how far this goes, I loaded a gif instead of an audio file and the same thing happened.  Progress went fine with no errors of any kind even though I registered for every listed event.  As expected though, no sound played from the gif file.
    What is the recommended way for checking if a file is not playable?

    I'm looking more for an "is it playable" value (since it might be an FLA or FLV as well).
    Even a meaningful length value would work (for some reason duration is set to a value even when loading a gif file - not sure what it means for a GIF to have a length of 96 milliseconds).
    For now I'll have to filter on extension as you mentioned.

  • Dynamic Variable Naming for Sound Object

    Is it possible to dynamically name a variable? I'd like to
    create a new Sound Object on the fly, so that I can use the
    Sound.load() method multiple times. I would simply like to create
    and name the variable and add a number to the end of the name
    (i.e.; var "audio_1":Sound). I'm sure that this is possible.
    However, I can't seem to get it figured out.

    This code worked great! However, how can I set a global
    variable equal to the newly created Sound Object so that it is
    available globally via a reuseable reference?
    Here's an example of how I attempted to do this. Please note:
    audioObject is a global variable that I am trying to use to
    reference the new Sound Object in various places.
    audioObjectCount is a global variable that I am using to set
    or get the next number to use when dynamically creating the next
    new Sound Object

  • Out of memmory with Sound object

    Hello,
    I have 2k+ of mp3 files and i need form playlist based on id3 tags. When i create air.Sound object in JS I run load() method and get ID3 tags in COMPLETE event handler. After that i create new Sound object for next file and all looks fine but near 900 file I get Out of memmory error. Whats wrong?
    Before create new object I set old variable value to NULL.

    Below is my basic code. I can convert it into something even more bare if needed. Basically I scan the hard drive for mp3 and AAC's, then pass the file object to this class to get the id3 tags. I've tried deleting sound, setting it to null, but no matter what I seem to have the song sticking in memory. It seems to be about 8MB of RAM for each sound object opened.
    NX.Sound = Class.create(,
         getId3Object: function(file, onComplete){
              var urlRequest = new air.URLRequest(file.url);                    
              var soundLoaderContext = new air.SoundLoaderContext(0, false);     
              var sound = new air.Sound();
              sound.addEventListener(air.Event.ID3, function(e){           
                var id3 = air.Sound(e.currentTarget).id3;
                id3.path = file.url;
                id3.title = id3.TIT2;
                id3.artist = id3.TPE1;
                sound.close();
                      onComplete(id3);
              sound.load(urlRequest, soundLoaderContext);

  • Multiple sounds, One sound object.

    So,
    What I want to do is load in a narrative, based on what a
    person is doing in a game. I create a sound object, load in a sound
    and play it. But, once the user does something, i want to stop that
    sound and start up another sound. I don't want to use
    stopAllSounds() because of sound effects and what not. I made a
    custom function. The way my head tells me this will work is that
    when I cue one sound, it will start playing, and if I cue another
    by calling playSound(), it will destroy the old instance (because
    it is stopping it and clearing it by creating a new sound with the
    same name) and start playing my new sound. What is wrong with my
    logic here?
    function playSound (mySound) {
    narrationSound.stop();
    var narrationSound:Sound = new Sound ();
    narrationSound.attachSound (mySound);
    narrationSound.start ();

    Which option?

Maybe you are looking for

  • Clicking on PDF files on the internet does not download with file extension

    When I click on a PDF link it downloads the file but does not save it as a ".pdf" file extension. When using the "save as" function in mozilla the ".pdf" file extension is included.

  • Should I increase TEMP tablespace size here ?

    Version: 10.2.0.4 Platform : RHEL 5.8 Currently we are running a batch job in a schema. The default temporary tablespace for that schema is TEMP. But I see that the tablespace is full. SQL> select file_name, bytes/1024/1024/1024 gb from dba_temp_file

  • AppStore does not allow downloading Chrome

    Does anyone else have the same problem and preferrably a solution for this Leaving aside all the stupid changes Apple's new management has allowed to ruin user experience (except swipe in iOS7), does anybody have the same problem that AppStore blocks

  • Unable to update my 8Gb Nano

    HELP! My 8Gb Nano has software V1.0.2. Itunes tells me a new software version is available for my Nano but when I try to update to v1.1 I am told that "the Ipod cannot be updated because it contains files that are in use by annother application". Thi

  • Adobe Business Catalyst email file size limits?

    Is a limit to the size of files that can be sent through Adobe Business Catalyst email?