movie player... need help

Just starting out? Need help? Post your questions and find answers here.
Dremth
User
User
Posts: 27
Joined: Sat Jul 10, 2004 5:24 pm
Location: My Computer
Contact:

movie player... need help

Post 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 :)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: movie player... need help

Post by NoahPhense »

edited.. may be removed by moderator
Last edited by NoahPhense on Fri Jul 30, 2004 4:15 pm, edited 1 time in total.
Dremth
User
User
Posts: 27
Joined: Sat Jul 10, 2004 5:24 pm
Location: My Computer
Contact:

Post by Dremth »

whats that do and where am i supossed to put it?
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post 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
Dremth
User
User
Posts: 27
Joined: Sat Jul 10, 2004 5:24 pm
Location: My Computer
Contact:

Post by Dremth »

cool
thanks
ummm... how are you supposed to have an icon for the window?
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

have a look at the command EventType() ... This might help.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

Man I'm slow at typing some times ... sorry for the delayed post :lol:
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
Dremth
User
User
Posts: 27
Joined: Sat Jul 10, 2004 5:24 pm
Location: My Computer
Contact:

Post by Dremth »

its ok
Dremth
User
User
Posts: 27
Joined: Sat Jul 10, 2004 5:24 pm
Location: My Computer
Contact:

Post by Dremth »

i dont really understand the eventtype() thing
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post 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
Dremth
User
User
Posts: 27
Joined: Sat Jul 10, 2004 5:24 pm
Location: My Computer
Contact:

Post by Dremth »

sweet
thanks a whole bunch
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

..

Post by NoahPhense »

Dremth wrote:sweet
thanks a whole bunch
As for different icons per different windows.. that's going to be different.

- np
Dremth
User
User
Posts: 27
Joined: Sat Jul 10, 2004 5:24 pm
Location: My Computer
Contact:

Post 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
Post Reply