how can make it ask when application exit if media player plugin is playing, and not ask if it is not playing ???
ask to exit help
Collapse
X
-
Code:if (MediaPlayer.GetState("Plugin1") == 2) then if (Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) == 6) then Application.Exit(); end else Application.Exit(); end
Also, next time include a project so we don't have to create a new one.
-
-
i tried that but it didnt work either !!!
Code:result = MediaPlayer.GetState("Plugin2") if ( result == 2) then ask = Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) if (ask == "CANCEL") then else Application.Exit(); end else Application.Exit(); end
Comment
-
-
result = MediaPlayer.GetState("Plugin2")
if ( result == 2) then
ask = Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1)
if (ask == "CANCEL") then else
Application.Exit();
end
else
Application.Exit();
end
"CANCEL" will never be returned using type MB_YESNO.
It's not tested, but should work for you.
Code:result = MediaPlayer.GetState("Plugin2") if ( result == 2) then ask = Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) if (ask == IDYES) then Application.Exit(); end else Application.Exit(); end
Comment
-
-
Code:if (MediaPlayer.GetState("Plugin1") == 2) then if (Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) == 6) then Application.Exit(); else Application.ExitScript(); end else Application.Exit(); end
Comment
-
-
Next time, read the manual.
there is a hidden global function "QueryAllowProjectClose()", use it !!
QueryAllowProjectClose ( )
Called whenever the project is 'told' to close. Using this function, you can control how the user can close the application, such as confirming with the user that they intended to close the application.Code:function QueryAllowProjectClose() if (MediaPlayer.GetState("Plugin1") == 2) then if (Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) == 6) then return true else return false end else return true end end
Last edited by RizlaUK; 04-16-2008, 08:44 AM.Embrace change in your life, you never know, it could all work out for the best
Comment
-
-
Originally posted by RizlaUK View Postlol
there is a hidden global function "QueryAllowProjectClose()", use it !!
Code:function QueryAllowProjectClose() if (MediaPlayer.GetState("Plugin1") == 2) then if (Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) == 6) then return true else return false end else return true end end
Comment
-
-
asks to close or not anyway... i dont want it to ask if mediaplayer is not playing... i dont understand what is wrong with it !!!
On Globals :
Code:function QueryAllowProjectClose() if (MediaPlayer.GetState("Plugin2") == 2) then if (Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) == 6) then return true else return false end else return true end end
Code:QueryAllowProjectClose()
Last edited by GoOgLe; 04-16-2008, 09:57 AM.
Comment
-
-
Originally posted by GoOgLe View Postasks to close or not anyway... i dont want it to ask if mediaplayer is not playing... i dont understand what is wrong with it !!!
On Globals :
Code:function QueryAllowProjectClose() if (MediaPlayer.GetState("Plugin2") == 2) then if (Dialog.Message("My Application", "Are you sure you would like to quit?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1) == 6) then return true else return false end else return true end end
Code:QueryAllowProjectClose()
just put the function in globals, no need to call it, it is done automaticlyno need to call it, it is done automaticlyit is done automaticlyautomaticly
Comment
-
-
Keep in mind...
You must first load a file into the MediaPlayer plugin before you can get the correct return codes.
You do not necessarily have to start the video automatically but you HAVE to at least load it.
Example:
MediaPlayer.Load("Plugin1", "AutoPlay\\Videos\\Magnolia.mpg");
Comment
-
-
Comment