- This topic has 57 replies, 11 voices, and was last updated 18 years ago by Admin.
-
AuthorPosts
-
June 23, 2006 at 1:32 pm #179683AdminAdministrator
Ah win cotrol is fast, well thas the only one i use so far 🙂 but for that you dont need a timer unless you want to do some sort of event after event,
lets say you have 3 sounds, and you want after one sound go to the next then you need to use a timer to check when the first sound has stop 🙂
but if u just need to click on a sound one by one u dont need the timer 8)
June 23, 2006 at 1:35 pm #179682AdminAdministratorAnd yes it will play mp3 wavs and wma 🙂
June 23, 2006 at 1:48 pm #179681methodMember@Admin wrote:
Ah win cotrol is fast, well thas the only one i use so far 🙂 but for that you dont need a timer unless you want to do some sort of event after event,
lets say you have 3 sounds, and you want after one sound go to the next then you need to use a timer to check when the first sound has stop 🙂
but if u just need to click on a sound one by one u dont need the timer 8)
loco thanks for u explantion. i am not clicking i am placing it inside if statment so do i need timer? i placed the play code inside if statement and it is play when condition becomes false !! and when condition for the sound to play is true the media play shows opening and never plays it and when i make the condition false it plays it. I make the condition false by pressing a button to change the value of text6.text and makeing it true to change value of text6.text
do u know what i am doing wrong ? It is strange !! why this reverse logic?
if (Text1 = 1296889) Then
Label2.Caption = "sound"
ElseIf Text1 = 58519 Then
Label2.Caption = "Sorry no sound"
WindowsMediaPlayer1.URL = Text6.Text
WindowsMediaPlayer1.Controls.play
Else
Label2.Caption = "defualt no sound"
End IfJune 23, 2006 at 2:00 pm #179680AdminAdministratoryeps then you going to need a timer for that to check when its false
so it be something like this on the timer
If cond = false then
wmp.URL = Text1.Text
wmp.Controls.play
End Ifnow the question is how many sounds you trying to play and where are they located, if the located in different textboxes, instead of a list its easy 🙂
you would do somehtign like this
If cond = false then
wmp.URL = Text1.Text
wmp.Controls.play
End If
If cond2 = false then
wmp.URL = Text2.Text
wmp.Controls.play
End If
If cond3 = false then
wmp.URL = Text3.Text
wmp.Controls.play
End If
ect.....June 23, 2006 at 2:15 pm #179679methodMemberloco see this code is showing the lables corectly acroding to value of text but it does not play the sound corectly and it is in timer:
Private Sub Timer1_Timer()
...............
..............
if (Text1 = 1296889) Then
Label2.Caption = "sound"
ElseIf Text1 = 58519 Then
Label2.Caption = "Sorry no sound"
WindowsMediaPlayer1.URL = Text6.Text
WindowsMediaPlayer1.Controls.play
Else
Label2.Caption = "defualt no sound"
End If
End Sub
when Text1 = 1296889 it has to play the sound
but it shows opeing in media player and never plays the sound and when Text1 = 58519
it should not play the sound but it does play the sound. Why is this reverse logic? text1 is value inside textbox that changes acording to mouse moving and it is data obtained inside same timerJune 23, 2006 at 2:20 pm #179678AdminAdministratorumm why u closing this
if (Text1 = 1296889) Then
i think it should be liek this
if Text1 = "1296889" Then
🙂 try tha
June 23, 2006 at 2:21 pm #179677AdminAdministratorso it would look liek this
Private Sub Timer1_Timer()
if Text1 = "1296889" Then
Label2.Caption = "sound"
ElseIf Text1 = "58519" Then
Label2.Caption = "Sorry no sound"
WindowsMediaPlayer1.URL = Text6.Text
WindowsMediaPlayer1.Controls.play
Else
Label2.Caption = "defualt no sound"
End If
End SubJune 23, 2006 at 2:28 pm #179676methodMemberman same strange behaviour .I obtain the value of text1 from functon called text1=getcord(…..) and then i compare it with hard coded integers values and play diffrent sound but the logic is reverse i do not know why!!!
do i need to reset some thing?
Private Sub Timer1_Timer()
...............
..............
Text1=getcord(...)
if (Text1 = 1296889) Then
Label2.Caption = "sound"
ElseIf Text1 = 58519 Then
Label2.Caption = "Sorry no sound"
WindowsMediaPlayer1.URL = Text6.Text
WindowsMediaPlayer1.Controls.play
Else
Label2.Caption = "defualt no sound"
End If
End SubJune 23, 2006 at 2:50 pm #179675AdminAdministratorcrap i am confuse, wha intergers they numbers or letters?
June 23, 2006 at 2:54 pm #179674methodMember@Admin wrote:
crap i am confuse, wha intergers they numbers or letters?
They are pure integers comparsion!
June 23, 2006 at 3:06 pm #179673AdminAdministratorAigh this might be crazy but once i try to compare numbers that are more then two digits lol aigh try this and could do it right untyl i did this
If CInt(Text1) = CInt("1296889") Then
Label2.Caption = "sound"
ElseIf If CInt(Text1) = CInt("58519C") Then
Label2.Caption = "Sorry no sound"
WindowsMediaPlayer1.URL = Text6.Text
WindowsMediaPlayer1.Controls.play
Else
Label2.Caption = "defualt no sound"
End IfJune 23, 2006 at 3:17 pm #179672methodMember@Admin wrote:
Aigh this might be crazy but once i try to compare numbers that are more then two digits lol aigh try this and could do it right untyl i did this
If CInt(Text1) = CInt("1296889") Then
Label2.Caption = "sound"
ElseIf If CInt(Text1) = CInt("58519C") Then
Label2.Caption = "Sorry no sound"
WindowsMediaPlayer1.URL = Text6.Text
WindowsMediaPlayer1.Controls.play
Else
Label2.Caption = "defualt no sound"
End Ifoverflow error at:
If CInt(Text1) = CInt(“1296889”) Then
If CInt(Text1) = CInt("1296889") Then
Label2.Caption = "sound"
ElseIf CInt(Text1) = CInt("58519C") Then
Label2.Caption = "Sorry no sound"
WindowsMediaPlayer1.URL = Text6.Text
WindowsMediaPlayer1.Controls.play
Else
Label2.Caption = "defualt no sound"
End IfJune 23, 2006 at 3:55 pm #179671AdminAdministratorah damn, hehe well can i see the code and take a look at it 🙂 cause i got no more ideas 🙂
-
AuthorPosts
Related
- You must be logged in to reply to this topic.