_root.createEmptyMovieClip = little problem

Hello All,

I’m using this little script to open an external jpg file it’s for a photo gallery:

on (release) {
_root.createEmptyMovieClip(“holder”,1);
holder.loadMovie("…/pic/photo1.jpg");
holder._x= 200, holder._y = 150 ;
}

That’s working fine… :o)

the only propblem, is that I cannot close it !
the picture stays on top of the all movie…

:o/

any hint ?

Thanks!
JP

this
holder._x= 200, holder._y = 150 ;
should be
holder._x= 200;
holder._y = 150 ;

what do you mean by “close it”?
of course it stays on top, as you create the empty clip at a depth of 1 in _root…

Thanks for the correction Eyezberg, I get the concept of levels, and it’s fine that this picture stays on top, it’s when I don’t want the picture anymore on the screen, I don’t know hoe to unload it, I tried a bunch of different things (logical for me but not really for Flash!) I thought for exampl IF:

holder.loadMovie(“…/pic/photo1.jpg”); loads the jpg in the MC container,

holder.UNloadMovie(“…/pic/photo1.jpg”); would unload it…

Well, It didn’t …
Where I am mistaken… ?
Thanks guys,

Well you could try unloadMovie(“yourMC”); instead of UNloadMovie(“yourMC”); … :wink:

Thanks, newhopekenny!, that’s working BUT now this action remove all the movies! … the one on level 0 as well (menu etc…)

The action for the “return to menu” button is:
[color=blue]on (release) {
_root.unloadMovie(“holder”,1);
this._parent.gotoAndPlay(‘main-menu’);
}[/color]
[color=black]That is the code on another button that create the MC-holder and load the jpg:[/color]
[color=blue]on (release) {
_root.createEmptyMovieClip(“holder”,1);
holder.loadMovie(“…/pic/photo1.jpg”);
holder._x= 200;
holder._y = 150 ;
}[/color]
[color=black]Any idea…? I think we are verrrry close![/color]
[color=black]Thanks ![/color]

Do you HAVE TO unload?
Can’t you just move it off screen by resetting it’s _x or _y value, or setting it’s _visible to false?

bad code, dont do _root.unloadMovie(blah)…do this
_root.holder.unloadMovie()

-Jake

Thanks to all of your guys, and to Jack!

Now it’s working !

Best to All !