um it works fine with a few changes, i am in a rush to go so i havent cleaned this up, but you can go back to using no backdrop if you like, i just needed to read fps properly so i could set suitable increments for volume so its got boundaries and doesnt change at the frame rate of max frames - my machine does it over 1000fps so with your code it went from 0 to 100 in 1 press
edit - read remmed out notes to see differences in code
`%Project Title%
`%Source File Name%
`======================
`CIT 458
`Last updated: 3-27-2012
set display mode 1024,768,32,1 `<--need this to cap framerate explained at bottom of code
sync on
backdrop on `<---this is so i dont have to cls to update fps text which would remove avi from render
`also gives you better opportunities to make things look pretty with images/sprites/bitmap fonts
color backdrop 0
set window size 400,400
load animation "E:\Videos\films\300.avi",1
`The above initializes the program by clearing the screen, setting the display size and loading the movie file
wait 1000
play animation 1
soundVal# = 85 `min according to helpfiles - 100 is max
set animation volume 1, soundVal#
`The above sets up the volume control and starts the movie
do
`this bit limits volume so you dont lose where its limits are:
if soundVal#<85 then soundVal#=85
if soundVal#>100 then soundVal#=100
if upkey() = 1
soundVal# = soundVal# + 0.25 `changed increments/decrements to suit smaller range of 15 units
set animation volume 1, soundVal#
endif
`The above ups the volume when the up key is pressed
if downkey() = 1
soundVal# = soundVal# - 0.25
set animation volume 1, soundVal#
endif
`The above lowers the volume when the up key is pressed
if keystate(50) = 1
set animation volume 1, 0
endif
`The above mutes the volume when the M key is pressed
if keystate(22) = 1
set animation volume 1, soundVal#
endif
`The above unmutes the volume when the U key is pressed
`k so i replaced this cos your last keystate check was a repeat plus the condition was wrong an not needed
`instead of wait 500 you can do test for key release etc which there is code somewhere on this forum so then you wont appear to have an actual pause time between resuming and pressing the spacebar
if SpaceKey() = 1
if animation paused(1)=1
resume animation 1
else
pause animation 1
endif
wait 500
endif
`The above pauses the movie when the Space key is pressed
if keystate(25) = 1
stop animation 1
play animation 1
endif
`The above restarts the movie from the beginning when P is pressed
gosub display
sync
loop
end
`%Project Title%
`%Source File Name%
`======================
display:
line 0,50,650,50
line 0,55,650,55
line 325,0,325,350
set text size 50
center text 150,5, "Action"
center text 475,5, "Key"
set text size 27
line 0,100,650,100
center text 150,65, "Play/Restart"
center text 475, 65, "P"
line 0,150,650,150
center text 150,115, "Pause/Resume"
center text 475, 115, "Space Bar"
line 0,200,650,200
center text 150,165, "Mute"
center text 475, 165, "M"
line 0,250,650,250
center text 150,215, "Un-Mute"
center text 475, 215, "U"
line 0,300,650,300
center text 150,265, "Volume Up"
center text 475, 265, "Up Arrow"
line 0,350,650,350
center text 150,315, "Volume Down"
center text 475, 315, "Down Arrow"
set text size 70
center text 325,375, "Mars Landing"
`The above draws the instructions box
`you can replace following or remove - displays volume value on left fps on right
`this is from debug to determine fps cos sync rate command must not be used with this code
`or nothing is diplayed unless its uncapped which we need
`to cap so we have better control of volume ie not to quick or slow to change
`(vsync flag on set display command in first line limits it instead)
Set text size 30
center text 200,360, str$(soundVal#)+" "+str$(screen fps())
return