Hello again lovley Kirupa people
Iâm having some technical difficulties with a bit of flash Iâm working on (I bet youâve heard that one before) - let me outline whatâs going on hereâŚ
First off I have a little movie called âbackground.swfâ, which is a lovley scrolling background affair which uses the following actionscript to operate:
onClipEvent (enterFrame) {
if (_parent.mainVar == 0) {
homeX = (-_parent._xmouse*1.4);
} else {
homeX = (-_parent.mainVar*1.4);
}
thisX = _x;
diffX = homeX-thisX;
if (_parent.mainVar == 0) {
moveX = diffX/40;
} else {
moveX = diffX/5;
}
_x = thisX+moveX;
}
This all works just fine, when you move the mouse, the background scrolls perfectly, and when exported it looks like thisâŚ
[center]
*[size=1]exported âbackground.swfâ â 460 x 380 pixels
[/size]* [left][size=2]I also have a second movie, which is the main movie. I wish to load the background movie into the main movie, so I used the following actionscript:
_root.createEmptyMovieClip("container", 1);
loadMovie("background.swf", "container");
container._x = 150 ;
container._y = 20 ;
This does indeed load the background.swf movie clip into the the main one, but it doesnât âconstrainâ it to the correct dimensions (460x380) and it spills out over the edges (see below)
[/size] [center]
[size=1]*the âmain.swfâ movie exported â see how the background.swf spills outâŚ
*[/size] [left]Now what appears to be happening is that my actionscript for the scrolling background appears to be working on the main.swfâs document dimensions rather than the background.swfâs document dimensions.
So, what I am asking is - is there a way for me to load a movie into a container which it will not spill out over from, or do I need to modify my actionscript for the background scoller?
Any help will be greatly appreciated, if you need me to post my fla files I canâŚ
Thanks
jonny.
[/left]
[/center]
[/left]
[/center]