Click to See Complete Forum and Search --> : NH w/ Img arrays and 2 timers
breeze19965
September 13th, 2001, 07:28 PM
Working on a project for class dealing with 4 image arrays (imgFace) and 2 timers(tmrFace1/tmrFace2). The scenerio reads like this; you have 4 images that are hidden and must use timer 1 to bring each one up after 500 milliseconds have lasped, then turn off timer one and turn on timer 2 in which timer 2 hides each image one at a time after 50mls, but it keeps going until the user clicks the exit button. Well so far I have been able to get imgFace(0,2,3) to come up with 3 blinking. Go figure. I'm stumped and need help. Here is the code I have so far.
(Gen. Dec.)option explicit & Dim intNum as Integer
tmrFace1
imgFace(intNum).Visible = True
intNum = intNum + 1
If intNum >=3 Then
intNum =3
end if
tmrFace1.enable=false
tmrFace2.enable=true
tmrFace2
imgFace(intNum).Visible =False
intNum = intNum +1
If intNum >=3 Then
intNum =3
end if
tmrFace2.enable=false
tmrFace1.enable=true
Now any help would be wonderful....
And THANK YOU in advance.
Cakkie
September 14th, 2001, 01:22 AM
The code does what it supposed to do, maybe not what you like it to do, well look at this together
intNum = 0
Show face 0
intNum = 1
Hide Face 1 which isn't visible at the time
intNum = 2
Show Face 2
intNum = 3
Hide Face 3 which isn't visible at the time
intNum = 4
intNum = 3
Show Face 3
intNum = 4
intNum = 3
Hide Face 3
intNum = 4
intNum = 3
Show Face 3
intNum = 4
intNum = 3
Hide Face 3
...
...
If I understand correct, it should be this
private Sub tmrFace1_Timer()
imgFace(intNum).Visible = true
intNum = intNum + 1
If intNum > 3 then
intNum = 3
tmrFace1.Enabled = false
tmrFace2.Enabled = true
End If
End Sub
private Sub tmrFace2_Timer()
imgFace(intNum).Visible = false
intNum = intNum - 1
If intNum > 3 then
intNum = 3
tmrFace1.Enabled = true
tmrFace2.Enabled = false
End If
End Sub
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
breeze19965
September 14th, 2001, 07:08 PM
Thanks Cakkie, but it brought them all up and did what it is suppose to do. Though I have a question, would the formatting you passed along be considered a looping program, because I thinks that's what the instructor wants, though I will turn it in the way you showed me and I am very greatful for you help. Though I can't figure out why I didn't see it for myself...I must of been having a really bad brain day... Or it could be that studing VB, C++ and Database all at once must be getting to my brain and scrambling together. Thanks again....
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.