on startMovie
-- load main movie or script from Documents folder
main = getHome()&"/Documents/main"
if bx_exists(main&".dir") then
_movie.go(1, main&".dir")
else if bx_exists(main&".ls") then
m = new(#script)
m.name = "main"
ba = bx_file_get_contents(main&".ls")
str = ba.readRawString(ba.length)
m.scripttext = str
call(#startMovie, [script("main")])
else if bx_exists(main&".js") then
m = new(#script)
m.name = "main"
m.scriptSyntax = #javaScript
ba = bx_file_get_contents(main&".js")
str = ba.readRawString(ba.length)
m.scripttext = str
h = script("main").handlers()
if h.getPos(#startMovie) then
script("main").startMovie()
end if
else
put "[msg] Error: no main.dir/main.ls/main.js found!"
put "[msg] Upload main.dir or main.ls or main.js into the app's Documents folder, and then start this app again."
end if
end