Advanced Script Help
from
WinCustomize Forums
Trying to slim down some scripts and/or put everything into one base script. I've encounter somewhat of a little block.
Instead of using a dozen timers that essentially do the same thing I'm trying to pass the object down through the function call into the sub's but for some reason I can't pass the object name from the function into the respective timer. Any Ideas?
Instead of using a dozen timers that essentially do the same thing I'm trying to pass the object down through the function call into the sub's but for some reason I can't pass the object name from the function into the respective timer. Any Ideas?
Code: vbscript
- Const mskT1="mskTab1"
- Const objT1="objTab1"
- Dim speed
- speed=50
- '--Begin Universal Button Functions
- '--Left Click Mouse Selection
- Function Object_OnLbuttonupEx(obj,x,y,dragged)
- With DesktopX
- If Not dragged Then
- Select Case obj.name
- Case objT1
- tBarSlide(mskT1)
- End Select
- End If
- End With
- End Function
- Function tBarSlide(obj)
- With DesktopX
- If .Object(obj).Left >= 0 Then
- object.KillTimer 100
- object.SetTimer 200,speed
- Else
- object.KillTimer 200
- object.SetTimer 100,speed
- End If
- End With
- End Function
- '--Timers
- Sub object_ontimer100
- With DesktopX.Object(obj)
- If .Left < 0 Then
- .Left = .Left + 5
- Else
- object.KillTimer 100
- End If
- End With
- End Sub
- Sub object_ontimer200
- With DesktopX.Object(obj)
- If .Left >=0 Then
- .Left = .Left - 5
- Else
- object.KillTimer 200
- End If
- End With
- End Sub