A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Sound.start() won't use correct position

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    26

    Sound.start() won't use correct position

    I'm working on a mp3 player with a "popup" button. When you click the button, the player stops playing, and launches a .swf popup that takes over playing the song where it left off.

    However - the popup player insists on starting at the very beginning of the song, even though I'm pretty sure I'm telling it not to. I use this function, which is identical in main player and popup:

    Code:
    function musicPlay():Void {
    	trace("musicPlay() - songPosition = "+songPosition);
    	mySound.start(songPosition/1000,9999);
    }
    In the main player, this works just fine. But in the popup - the song starts from the very beginning, and disregards songPosition, although the trace shows that songPosition is set to the correct value.

    Any thoughts?

  2. #2
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    make sure you have target paths correct incase the code is in a different movie clip.

    You might try tracing
    trace(mySound.position);

    or use
    mySound.start(mySound.position/1000,9999);

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    26
    Hey, hp3, thanks for answering!

    I'm tracing mySound.position, and it shows that the sound restarts from 0, which I don't want it to do.

    Using "mySound.start(mySound.position/1000,9999)" won't help much - that'll just start the sound from its current position, while I want it to start from a different point; and since I can't set mySound.position (it's read-only), I can't use that roundabout way of getting it to play correctly.

    Not sure what you mean by "target paths". The sound objects are in two different movie clips (which are identical in most respects). I can manipulate them individually in most respects (i. e. pause one, set volume on another, without them affecting eachother). However, all of a sudden I can't seem to start one of them playing where I want it to...

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