Loadmovie question

why does this code not work for me when placed in a MC?

portfolio.onPress = function() {
_root.createEmptyMovieClip(“container”, 1);
loadMovie(“portfolio.swf”, “container”);
container._x = 122;
container._y = -4;
};

it works fine and the movie loads when the code and button is placed on the main scene though.

I’ve tried _parent.createEmptyMovieClip(“container”, 1);
but this doesn’t seem to work either.

if you’re creating it in _root, would you want to do this:

[AS]
portfolio.onPress = function() {
_root.createEmptyMovieClip(“container”, 1);
loadMovie(“portfolio.swf”, “_root.container”);
_root.container._x = 122;
_root.container._y = -4;
};
[/AS]

those times when you don’t use _root, it’s probably just looking for a non-existent movie within that movie clip.

Brilliant! thanks alot, works like a charm:)