Loading a Jpg From Acces Database?

Hi to everyone…

My problem is simple. I did it with a button but a need without button. Here it is ;

I made an asp which was displaying an output from an acces DB like ;

&news=example&news_image=example.jpg&result=ok

i’m getting the variables to my swf. When i try to load image at Frame 3 there is nothing. Here is the code.

Frame 1
var news_img
loadVariablesNum(“news.asp”, 0);

Frame 3
news_img=news_image
loadMovie(“news_img”, “news_image_mc”);

Frame 5
if (result==“ok”) {
gotoAndStop(7);
} else {
gotoAndPlay(3);
}

Frame 7
stop();

What’s the problem do you think ? By the way, as i say at the top, button solve the problem but i don’t want users must click a button. it loads the jpg file when the page opened.

Thanx For All…

Try:
loadMovie(news_img, “news_image_mc”);

The quotes around it was thinking it was text instead of a variable.

Hi again…

Sorry i do it like you said :slight_smile: i know it’s a variable so anyway, it’s still not working… :(:frowning:

loadMovie(news_img, “news_image_mc”);

it must be like this but where is the problem ?

hard to say, do some testing on it, maybe the path to the variable is wrong. and you’ll need a _parent or something.

on frame 3:
trace(news_img)

then test your movie, if it is even getting there, it will tell you what it’s trying to load.

I tried everything… the path of the image and instance name of the movie clip are true. If it’s not true, the button will not load the image, am i wrong ?

tanx for your reply ?

what if you hardcode it for testing:
loadMovie(“example.jpg”, “news_image_mc”);

If it’s not loading, check that the swf and jpg are in the same file. And make sure your movieclip is definitely viewable on screen.

That’s all I can think of. You just need to find out where it’s not working.

when i give this code at frame 3;

loadMovie(“example.jpg”, “news_image_mc”);

it’s working…

but when i give this code ;

loadMovie(news_image, “news_image_mc”);

it’s not working… But when i set this code to a button it’s working… (The trace result is = example.jpg)

Finally it’s working when a button calling this code but when a frame or movie call this code it’s not working… i mean this code ;

[COLOR=blue]loadMovie(news_image, “news_image_mc”);[/COLOR]