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