View Full Version : problems loading swf
cameron_
October 24th, 2005, 09:15 PM
this.onPress = function () {
_root.createEmptyMovieClip("container",1);
loadMovie("loaded.swf","container");
container._x = 150 ;
container._y = 20 ;
}
i am using the complex rollover button tut from this this site as well. I don't see anything when i try the code. When it goes to the root, does it automatically go to the first frame? what if my buttons are on the 4 frame?
XwhyZ
October 25th, 2005, 01:30 AM
[QUOTE=cameron_]
this.onPress = function () {
_root.createEmptyMovieClip("container",1);
loadMovie("loaded.swf","container");
container._x = 150 ;
container._y = 20 ;
}
That should be...
this.onPress = function () {
_root.createEmptyMovieClip("container",1);
container.loadMovie("loaded.swf","mcLoaded");//"mcLoaded' will be the new name... or whatever
container._x = 150 ;
container._y = 20 ;
};
I think that should work now
Cheers!!!
Barn
October 25th, 2005, 11:23 AM
[QUOTE=cameron_]
this.onPress = function () {
_root.createEmptyMovieClip("container",1);
loadMovie("loaded.swf","container");
container._x = 150 ;
container._y = 20 ;
}
That should be...
this.onPress = function () {
_root.createEmptyMovieClip("container",1);
container.loadMovie("loaded.swf","mcLoaded");//"mcLoaded' will be the new name... or whatever
container._x = 150 ;
container._y = 20 ;
};
I think that should work now
Cheers!!!
No, that's not correct, XwhyZ. In order for that to work, the movieclip mcLoaded would have to have been already created inside the container movieclip (which, not incidentally, carries with it the primary problem from the original script -- that the container movieclip does not exist in the scope of the button; it resides on the _root.
this.onPress = function() {
_root.createEmptyMovieClip("container", 1);
_root.container.loadMovie("loaded.swf");
_root.container._x = 150;
_root.container._y = 20;
};
Or, more simply, create a reference to avoid all the extra typing:
this.onPress = function() {
var rfcClip = _root.createEmptyMovieClip("container", 1);
rfcClip.loadMovie("loaded.swf");
rfcClip.container._x = 150;
rfcClip.container._y = 20;
};
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.