Results 1 to 15 of 15

Thread: Please tell me what I'm doing wrong:

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    please help, what I"m trying to do is have the object labeled Flash1 to go diagonal down the current coordinates of it is -5000(left) & -5240(top)

    Code:
    Dim intflashL As Single
    Dim intflashT As Single
    __________________________________________
    Private Sub Timer2_Timer()
    If Flash1.Left = 0 Then
    Else:
    intflashL = intflashL + 1000
    intflashT = intflashT + 1000
    intflashL = Flash1.Left
    intflashT = Flash1.Top
    End If
    End Sub
    OH YEA.... I forgot to tell you my problem its:

    when ever I start it it doesn't start at -5000,-5240
    it just styarts in the middle of the screen, and goes dianolly down


    thanks in advance
    NXSupport - Your one-stop source for computer help

  2. #2
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136

    Spot the difference

    Code:
    Dim intflashL As Single
    Dim intflashT As Single
    
    Private Sub Timer2_Timer()
       If Flash1.Left = 0 Then
       Else:
          intflashL = intflashL + 1000
          intflashT = intflashT + 1000
          Flash1.Left = intflashL
          Flash1.Top = intflashT
       End If
    End Sub
    I'm not sure what all that 'Else:' business is about...
    Visual Basic 6 Enterprise Edition + SP4

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715

    Re: Spot the difference

    thank you, but when I click "play" it goes diananol, but it starts in the middle of the form, not at -5000,-5240
    NXSupport - Your one-stop source for computer help

  4. #4
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    I need more data, whats are all the Scale* settings for your
    form (.left .top. width. .height)
    Also give initial top and left setting of flash1
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  5. #5
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136

    Unhappy Hmmm

    Looks like I misunderstood your predicament. From a first look at the code you posted, I wouldn't expect the object to move at all.

    Anyway, perhaps you can explain what kind of object 'Flash1' is, and also, what exactly you are trying to achieve with it? You really didn't give much away before...

    Visual Basic 6 Enterprise Edition + SP4

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715

    Re: Hmmm

    what I'm trying to do is move the flash moive from -5000(left, where it is right now), and -5240(top, where it is right now).
    to:
    0 left, and 240 top

    now do you know what I mean?
    NXSupport - Your one-stop source for computer help

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715

    Re: Re: Hmmm

    oh yea, the width and height are: 7455, and 3255
    NXSupport - Your one-stop source for computer help

  8. #8
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Try this
    code:
    Private Sub Timer2_Timer()
    If not Flash1.Left <=1000 Then
    Flash1.Left=Flash1.Left+1000
    Flash1.Top=Flash1.Top+1000
    Else
    Flash1.Left=0
    Flesh1.Top=240
    End If
    End Sub
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  9. #9
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Sorry, I tried to use the Code Format, but may I'm just to st....
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  10. #10
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'if I use -5000 and -5240 then the object is not on the
    'form and just appears at 0 - 240 top left...
    
    'if i set it to the bottom right hand corner of the form
    'and apply this it goes diagonally from bottom right to top left.
    
    
    Private Sub Form_Load()
    
        Flash1.Left = 5000
        Flash1.Top = 5240
    
    End Sub
    
    Private Sub Timer2_Timer()
        Call MoveFlash
    End Sub
    
    Public Sub MoveFlash()
    
        Dim intflashL As Single
        Dim intflashT As Single
        
        
        If Flash1.Left = 0 Then
        Else:
            intflashL = intflashL + 1
            intflashT = intflashT + 1
            Flash1.Left = intflashL
            Flash1.Top = intflashT
        End If
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  11. #11
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    opus
    to use code format.

    SquareBracketcodeSquareBracket
    bla bla code
    bla bla code
    SquareBrakcet/codeSquareBracket



    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    ok, thanks to ALL for you HELP!!!!!!
    NXSupport - Your one-stop source for computer help

  13. #13
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Thanks Joe
    I come to think Dimava uses something like [code]
    Form.ScaleTop=-8000
    Form.Scaleleft=-8000
    [code]
    ??
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  14. #14

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    you used this: (*s dont count)

    [*code*]

    then to close it

    [*code*]



    you should use this:

    [*code*]

    then to close it:

    [*/*code*]
    NXSupport - Your one-stop source for computer help

  15. #15
    New Member
    Join Date
    Jul 2000
    Posts
    1

    Thumbs up

    Well this is what i came up with...

    Private sub Form_Activate()
    'Set the image's location at the bottom left hand corner of the screen.
    Image.left = Form1.left
    Image.Top = Form1.ScaleHeight - Image.Height
    End Sub

    Private Sub Timer1_Timer()
    Image.Left = Image.Left + 30
    Image.Top = Image.Top - 30
    End Sub



    Just set your timer interval to 400.

    Next time don't think so hard..


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width