Page 1 of 1

movie player... need help

Posted: Fri Jul 30, 2004 3:59 pm
by Dremth
im making a movie player and i have a button in it and i don tknow how to do gosub when you click on the button... please help. heres the code:

Code: Select all

result = MessageRequester("DREMTH - MO0vie/Audi0 Player", "        Welcome to DREMTH's MO0vie and Audi0 player."+Chr(10)+"Would you like to enter the DREMTH MO0vie/Audi0 Player?", #PB_MessageRequester_YesNo)
If result = 7
    End
EndIf
If InitMovie() = 0
  MessageRequester("Error", "Can't initialize MO0vie/Audi0 file", 0) 
  End
EndIf
open:
MovieName$ = OpenFileRequester("MO0vie/Audi0 Selecter", "", "Movie/Audio Files (*.avi;*.mpg;*.asf;*.mp3;*.wav)|*.avi;*.mpg;*.asf;*.mp3;*.wav|All Files|*.*", 0)
If MovieName$
  If LoadMovie(0, MovieName$)
    If MovieHeight() > 0
      OpenWindow(0, 100, 150, MovieWidth(), MovieHeight()+70, #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget , "DREMTH - MO0vie Player")
        CreateGadgetList(WindowID(0))
          ButtonGadget(1, MovieWidth()/2-25, MovieHeight()+10, 50, 30, "Open")
        If MovieHeight() > 0
            If CreateStatusBar(0, WindowID() )
                AddStatusBarField(6000)
                StatusBarText(0, 0, "Playing MO0vie:"+MovieName$, 0)
            EndIf
        EndIf
    Else 
       OpenWindow(0, 100, 150, 500, 17, #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget , "DREMTH - Audi0 Player")
       If MovieHeight() < 0 
          If CreateStatusBar(0, WindowID() )
              AddStatusBarField(6000) 
              StatusBarText(0, 0, "Playing Audi0:"+MovieName$, 0)
          EndIf
       EndIf      

  EndIf    
    PlayMovie(0, WindowID())
          
    Repeat
    Until WaitWindowEvent() = #PB_EventCloseWindow
  Else
    MessageRequester("Error", "Cannot load the MO0vie/Audi0 file."+Chr(10)+"File may be corrupted or is an invalid Audi0/MO0vie file.", 0)
  EndIf
EndIf
Return 
i hope you all can help :)

Re: movie player... need help

Posted: Fri Jul 30, 2004 4:06 pm
by NoahPhense
edited.. may be removed by moderator

Posted: Fri Jul 30, 2004 4:10 pm
by Dremth
whats that do and where am i supossed to put it?

Posted: Fri Jul 30, 2004 4:17 pm
by NoahPhense
Dremth wrote:whats that do and where am i supossed to put it?
replace your Repeat - Until with this:

Code: Select all

Repeat
  Event = WaitWindowEvent()
  If Event = #PB_EventGadget
    GadgetID = EventGadgetID()
    If GadgetID = 1
      Debug "blah"
    EndIf
  EndIf
Until Event = #PB_EventCloseWindow
- np

Posted: Fri Jul 30, 2004 4:24 pm
by Dremth
cool
thanks
ummm... how are you supposed to have an icon for the window?

Posted: Fri Jul 30, 2004 4:25 pm
by Codemonger
have a look at the command EventType() ... This might help.

Posted: Fri Jul 30, 2004 4:25 pm
by Codemonger
Man I'm slow at typing some times ... sorry for the delayed post :lol:

Posted: Fri Jul 30, 2004 4:37 pm
by Dremth
its ok

Posted: Fri Jul 30, 2004 4:39 pm
by Dremth
i dont really understand the eventtype() thing

Posted: Fri Jul 30, 2004 4:40 pm
by NoahPhense
Dremth wrote:cool
thanks
ummm... how are you supposed to have an icon for the window?
Under the compiler menu.. under compiler options, you can add an icon
to your application.

- np

Posted: Fri Jul 30, 2004 4:47 pm
by Dremth
sweet
thanks a whole bunch

..

Posted: Fri Jul 30, 2004 4:51 pm
by NoahPhense
Dremth wrote:sweet
thanks a whole bunch
As for different icons per different windows.. that's going to be different.

- np

Posted: Fri Jul 30, 2004 5:03 pm
by Dremth
when i try to make the exe it says for every icon file i pick its corrupted or invalid... but they arent invalid i know that so i dont know how to make some kinda icon a different way