A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Loop position is bugged?

  1. #1
    Junior Member
    Join Date
    Jan 2003
    Location
    Israel
    Posts
    26

    Angry Loop position is bugged?

    Hi,
    If you import a wav or mp3 file into your scene and play it in a loop... there's no way you can tell how many times it was looped...

    If you check the position of the loop eveyframe you'll get some incrementing number... (Not really the position) so I guess that this is a position in a loooong looped sound, so I try to figure out the loop counter by dividing by the loop length... nop, not good... you'll get worng numbers, near but wrong...

    Here's an example:

    Code:
    var Loop:LoopClassLink = new LoopClassLink();
    var sc:SoundChannel;
    sc = Loop.play(0, 1000);
    
    // onEnterFrame
    addEventListener(Event.ENTER_FRAME, onFrameEnter);
    function onFrameEnter(e:Event) : void
    {
    	trace(sc.position/beat.length);
    }
    Can anyone help with this??

    Thanks
    Gil.

  2. #2
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    What if you just do the loop by adding a sound finished listener to the channel and replay it each time? Then you can count... does that get glitchy or something...? I would guess it worked in roughly the same way as adding a loopcount in the constructor...

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