PDA

View Full Version : Improving, but found another AS trap!



Inflicted
September 11th, 2003, 07:30 PM
I'm gettin' deeper & deeper!
I have a main.fla into which I load an external swf called brio.swf. In this brio.swf I load piraat.swf. The problem is, when I hit the "speelgoed" button in the main movie, and than "BRIO", it opens brio.swf, but when I hit the button that opens piraat.swf, it opens the swf in the wrong location, that is at: x=0 y=0!?
The button that opens piraat.swf has this action:

on (release) {
loadMovieNum("trein_bn.swf", 1);
}

Also, in brio.swf there are buttons that on mouse over should show jpg's. It doesn't in
main.fla. Maybe I'm just messing up AS. It's kinda confusing to explain, but if someone can please take a look at it...

http://www.tantesteef.nl/Files.zip

claudio
September 11th, 2003, 11:15 PM
var depth = 1000, x = 40, y = 60;
//depth and coordinates you want to load
this.onEnterFrame = function() {
if (this["_level"+depth]._width>0) {
delete this.onEnterFrame;
}
this["_level"+depth]._x = x;
this["_level"+depth]._y = y;
};
my_button.onPress = function() {
loadMovieNum("yourmovie.swf", depth);
};