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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FF and REW

Status
Not open for further replies.

manfishj

Programmer
May 30, 2002
44
US
Hi,

I am doing a project in which there are many slides. Each slide has a different audio file. On each page, there are controls for the audio. I need 2 scripts---one for the rewind button and one for the fast-forward button. I just need them to be able to search through the audio, but I'm having some trouble. Can anyone help? Thanks.

manfishj
 
I was having some problems trying to implement that. I used a few lingo sound commands. Like this.

--play button--
on mouseup me
puppetsound 1, "sound"
end

--FF button--
on prepareframe me
if the stilldown then
sound(1).currenttime = sound(1).currenttime + 1000
end if
end

--FF button--
on prepareframe me
if the stilldown then
sound(1).currenttime = sound(1).currenttime - 1000
end if
end

However this works intermittenly and quirkly. What you could do is have the buttons and each time you clicked them the sound went foward 2000 miliseconds. For somereason the sound wont move if i use the clik and hold method. Another cool thing you could do is a status bar. Make a bar and note its width. Then apply this script to it:

on prepareframe me
if objectp(sound 1) then
if sound(1).currenttime = 0 then
sprite(me.spritenum).width = 0
else
sprite(me.spritenum).width = 263 * (sound(1).currenttime / sound(1).endtime)
end if
end if
end
--note that 263 is the width of this particular bar at 100%

Now make a bitmap of a square. Put it over the other bar and put the SUBTRACT ink on it or some similar ink. Then add this script to it:

on mouseup me
sound(1).currenttime = float(float(float(the mouseh - sprite(me.spritenum).left) / sprite(me.spritenum).width) * sound(1).endtime)
end

These two bars and their scripts will work together so that when you click a place withing the secondbar, the bar and sound jump to it. This worx great. Have fun. If this script doesnt work, tell me, it may have mistakes. Ask me if you need more help.

 
By the way, make sure both the bars are the same length or it wont work right ;-)
 
Thanks, Fugigoose. I haven't tried the status bar yet, but the script you gave me works well. The only problem I'm having is....in the director movie, when I click and hold down the FF or rew button, it advances and works well, HOWEVER, when I create a projector, I have to keep clicking on it for it to work. It does nothing when I hold it down. Any idea why this would be happening ONLY in the projector?
 
I'm not sure, but I just noticed an error in my FF and RR scripts: they cancel eachother out. So if thats the script yur using that might be the problem, but why it works in the movie and not the projector, I dunno. The two scripts SHOULD look more like this:

--FF button--
on prepareframe me
if inside(the mouseloc, sprite(me.spritenum).rect) then
if the stilldown then
sound(1).currenttime = sound(1).currenttime + 1000
end if
end if
end

--RR button--
on prepareframe me
if inside(the mouseloc, sprite(me.spritenum).rect) then
if the stilldown then
sound(1).currenttime = sound(1).currenttime - 1000
end if
end if
end

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top