PDA

View Full Version : code problem



iceman4
April 1st, 2002, 10:13 PM
Hey everyone,

I'm having a code problem for an external swf that I'm loading into my main site. I have a button which has this code attached to it.
on (release) {
loadMovieNum("worktv.swf", 5);
_level5._x = -325;
_level5._y = -300;
_level5._alpha = 60;
}
and then I have an empty movieclip which has another set of code attached to it which is
onClipEvent (enterFrame) {
if (loaded>0 && loaded == _level5._totalframes) {
_root.percent = 100;
} else if (loaded<=0 && loaded<_level5._totalframes) {
_root.meback.attachMovie(_root.doormc);
_root.percent = Math.floor((_level5.getBytesLoaded/_level5.getBytesTotal)*100);
}
}
can someone please tell me why this isn't working I've tried everything and nothing seems to work. I would appreciate the help!!!

Thanks,

Kyle

upuaut8
April 1st, 2002, 10:31 PM
I'm not sure what it is you're trying to do here, but I can tell you that you cannot set the _x and _y possitions of a movie in a level. The upper left corner of the loaded movie will sync with the upper left corner of the movie in level0 no matter what you try to set it for.

To do that you'll need to create a movie clip on the level0 stage, give it an instance name, and then use
loadMovie("theLoadedswf.swf","theHolderMovieClip");

then if you address theHolderMovieClip by name, you can reposition it's _y and _x.

thoriphes
April 1st, 2002, 10:50 PM
you placed the movie on level 5. calling levels start from 0 (eg. _level0) so you should change all "_level5" to "_level4". it's the programmers counting system...we start from 0 :)