Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help please! Help with a Pause button 1

Status
Not open for further replies.

fjp476

Technical User
Dec 28, 2001
113
US
Can anyone help a noob with the script for a Pause button that will pause the playhead and an audio file that is playing in channel 1? For example say my audio file is called up using the following script:

on exitFrame me
puppetsound 1, "intro"
end

On my Pause button I've got this so far:

on mouseUp me
sound (1).pause()
end

Obviously I'm not controlling the playhead at all and I need a way to have the audio resume play. I'm sorry if my explanation's not clear enough, I'll glady give any more info that might help if you let me nowwhat you need. Thanks in advance for any help, it will be greatly appreciated.

Cheers~Frank
 
Hi,
I'm not sure if its correct to put puppetSound 1 "Intro" under the exitframe handler. Seems to me you are asking the sound to play again and again.

You can use sound(1).status to help you identify the state of your sound. For more information on this, look for "status" in the Help.

Briefly,
status = 3 = sound is playing and
status = 4 = sound is paused.

So, you can make use of status like this:
--------------------------------
on mouseUp me
if sound(1).status = 3 then
sound(1).pause()
else
sound(1).play()
end if
end
--------------------------------

And to loop the playback head, you can again make use of status:
--------------------------------
on exitframe me
if sound(1).status = 4 then go the frame
end
--------------------------------
There are also other commands like isBusy() but I prefer using status. And remember to define your sound first using puppetSound, otherwise Director wouldn't know what sound(1) is.

Hope this helps.




 
Thanks for the tips, I'll give it a whirl. :)

Cheers~Frank
 
Thanks Gazs! That worked like a charm. I really appreciate it, I can't wait to find time to get some serious Lingo training, it really does rock. :)

Cheers~Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top