PDA

View Full Version : Dynamic Images in Flash! Help!


alexfierro
2-9-05, 09:44 PM
Hey all,

Quick question! I am working on a Flash animation and I have nice 128 x 128 buttons. I need these buttons to dynamically load JPG graphics so that my client can merely update the pictures on the server to update the flash.

For example, I want the button to load www.MYSITE.tld/1.jpg as the graphic part for the button. And when my client wants to change the look of his button, all he has to do is replace 1.jpg with his own jpg.

Here's what I tried...
_root.createEmptyMovieClip("container",1);
container.loadMovie("photo.jpg");
container._x = container._y = 50 ;

_root.onMouseDown = function () {
startDrag ("container",false) ;
}
_root.onMouseUp = function () {
stopDrag () ;
}

I put in the ActionScript of the button that needs the dynamic image, but instead it just plops it in the middle of the SWF, instead of where I need it! Please Help!

corey snyder
2-14-05, 09:46 PM
you are confusing flash with your ._x and ._y commands

container._x = 50;
container._y = 50;

an eaiser way is to place a movie clip on the stage where you want you .jpg to load name it "container" or whatever and use the loadMovie() that way... the movie clip on the stage will act as a place holder for the .jpg, and you dont have to "unload" the movie either... why make things more difficult :)

good luck
corey