A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: create an event with sound position property

  1. #1

    create an event with sound position property

    I using a voice over on a project, and I would like to have the sound file trigger events.

    How do I make an action in my timeline to tell a sound when it gets to 30 seconds to tell a mc to do something?



    ander = new Sound(andersen_mc);
    ander.attachSound("andersen");
    ander.start(0,1);
    ander.setVolume(80);

    This is what I have on my timeline.How would I say at xxnumber of seconds tell yy_mc.gotoAndPlay(2);

  2. #2
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    you could try to use a frame based loop to repeatedly check the position property. When it is greater than or equal to 30 seconds execute some code.

    Code:
    function trackPosition(){
      if(ander.position >= 30000){
         // code to execute
         return null; // stop frame based loop
      }
    }
    
    onEnterFrame = trackPosition;

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