Results 1 to 8 of 8

Thread: Stupid Questions about Image and SWF

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    4

    Stupid Questions about Image and SWF

    Ok, I am getting back into VB Programming after a few years of nothing, and I unfortunatly lost all my Program Source files for reference.

    Anyway, stupid question.
    I want to get a Command Button Click to load a picture into my "Image" but it wont work. I want it to load the image from a folder in my Project folder. Meaning I dont want to have to link it to something like e:\games\prog\whatever.jpg Instead, I want it like prog\whatever.jpg

    Same goes for my Flash video also, I can do the long link to it (e:\games\prog\whatever.swf) and it works, but when putting just prog\whatever.swf I get a Missing Object error.

  2. #2
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    App.path & "\Whatever.jpg"
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    4
    Could you give me the exact code? Sorry, but I just cant seem to remember anything...

  4. #4
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    but that is the code!!!

    Its the File Path Code, When it needs the File Path for Whatever.jpg enter


    App.path & "\Whatever.jpg"

    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    4
    Hmmm...

    Ok, here's what I have tried, just to be clear.

    I first started by trying

    Image1.Picture = "logo.jpg"
    with that, and variations of it, I get a Type Mismatch Error.

    I also tried
    Image1.Picture = (logo.jpg)
    With that I get a "Object Requiered" error.

    If I simply put in App.path & "\Whatever.jpg", I get a Expected Expression Error.

    If I try Image1.Picture = App.path & "\Whatever.jpg"
    I get another Type Mismatch Error.

  6. #6
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    VB Code:
    1. Set Image1.Picture = LoadPicture(App.Path & "\logo.jpg")

  7. #7

    Thread Starter
    New Member
    Join Date
    Dec 2002
    Posts
    4
    Awsome, that works perfectly. Thanks for the help.
    Hopfully the old code I knew will come back to me unlike this little bit.

    One last question though. If I had, say for example, multiple command buttons loading a diferent picture in the Image1, does it in a way, un-load the old image? Or would an older PC get bogged down if the person where to be loading a lot of pictures this way?

  8. #8
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176
    OOOPS sorry didnt think you meant that!!!!

    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

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