Then the audioplayer should continue to exist no matter what else you do. (except assign it to something else) You can also pass a non-global audioplayer to the video routine:
audioplayer=createobject("roaudioplayer")
audioplayer=playvideo(content,audioplayer)
function playvideo(content as object, audioplayer as object) as object
...
return audioplayer
end function
a=createobject("roaudioplayer")
v=createobject("rovideoscreen")
'Setup the Content Metadata......
a.Play()
port = CreateObject("roMessagePort")
v.SetMessagePort(port)
v.Show()
while true
msg = wait(0, port)
if type(msg) = "roVideoScreenEvent" then
if msg.isScreenClosed()
print "This gets called right away, the video never plays"