Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 6 of 6

Thread: load image from db via php

  1. #1

    load image from db via php

    Hi,

    i am trying to create a slideshow in fmx 2004, at the mo i am doing it with the images in mysql db, then i pull them out via a show image page. Is this the best method or can flash do it better?

    Anyway i can't get this code to load the image:

    function positionIt() {
    this._x = 50;
    this._y = 50;
    }
    myLoadVars = new LoadVars();
    myLoadVars.load("loadImages.php");
    Photos = new Array();
    myLoadVars.onLoad = function (success) {
    if (success) {
    Photos = this.photoIds.split(",");
    this.createEmptyMovieClip("myjpg", 1);
    var link = "showimage.php?ID=";
    link += Photos[0];
    myjpg.onComplete = positionIt();
    myjpg.loadjpg(link);
    }
    };

    any help would be most appreciated.

    thanks

    ash
    Last edited by beforedawn; May 31st, 2004 at 04:23 PM.

  2. #2
    Code:
    loadMovie('phpAddressGoesHere');
    should work

  3. #3
    Hi,

    thanks for the reply.

    I now have this but no joy:

    function positionIt() {
    this._x = 50;
    this._y = 50;
    }

    myLoadVars = new LoadVars();
    myLoadVars.load("loadImages.php");
    Photos = new Array();
    myLoadVars.onLoad = function (success) {
    if (success) {
    Photos = this.photoIds.split(",");
    this.createEmptyMovieClip("myjpg", 1);
    var link = "imagedisplay.php?ID=";
    link += Photos[0];
    myjpg.onComplete = positionIt();
    myjpg.loadMovie(link);
    }
    };

    thanks

    ash

  4. #4
    hi,

    may I know the reason for using database,

    are you saving any data back to database?

    if you just want to take the data and display it, then i think no need of using database and PHP,

    simple XML can do that for you and there are lot of tutorials explaning about that,

    in Flash mx you have one sample file even,
    prathapsimha

  5. #5
    hi,

    yes the slideshow will be updated and the images saved in the db.

    thanks

    ash
    Last edited by beforedawn; June 2nd, 2004 at 04:56 AM.

  6. #6
    Hi,

    I think i have solved the issue. I was pulling the images from a db as a blob and so the link to the files was imagedisplay.php?ID=??, flash doesn't like this so I am using another method.

    thanks

    ash

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012