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!

controlling sound using lingo

Status
Not open for further replies.

spydersweb

Programmer
Aug 22, 2003
1
GB
Hi all

I am really stuck on this one. I want to start playing some narrative and then fade in a slide, once the narrative has finished I want to fade out the slide and move on to the next one.

I have attached the code I have so far.

Please help this is really bugging me.

regards
Graham
-- frame script
on prepareFrame me
sound(1).play(member("1"))
fadeinslide
end


on exitFrame me
if soundbusy(1) then
go to the frame
else
fadeoutslide
end if
end

-- global scripts

on fadeooutslide
repeat with x=1 to 50
if sprite(60).member.name <> &quot;slide2_1&quot; then
sprite(60).blend = sprite(60).blend -2
end if

sprite(61).blend = sprite(61).blend -2
updatestage

end repeat
end

on fadeinslide
repeat with x=1 to 50
if sprite(60).member.name <> &quot;slide2_1&quot; then
sprite(60).blend = sprite(60).blend +2
end if

sprite(61).blend = sprite(61).blend +2
updatestage

end repeat
end

 
The following frame script does:
- Start playing sound member &quot;narrative&quot; and fade in two graphics on start
- When &quot;narrative&quot; is finished, fade out two graphics and move onto the next frame

Two graphics are placed in Sprite 60 and 61. Their blends need to be set to 0 (invisible).
Code:
--
property soundStarted

on exitFrame me
  if voidP(soundStarted) then
    puppetSound 1, &quot;narrative&quot;
    soundStarted = 1
  else
    if soundBusy(1) then
      if sprite(1).blend < 100 then
        repeat with i = 60 to 61
          sprite(i).blend = sprite(i).blend + 2
        end repeat
      end if
    else
      if sprite(1).blend > 0 then
        repeat with i = 60 to 61
          sprite(i).blend = sprite(i).blend - 2
        end repeat
      else
        soundStarted = VOID
        go the frame + 1
      end if
    end if    
  end if
  go the frame
end exitFrame
--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top