Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : loadMovie() & onRollOver question


CyberFred
5/24/2004 10:10:40 PM
Hi,

I've got an external swf which contains a shape:

lineStyle(10, 0x000000, 100);
lineTo(100,100);

In my main swf file I then load this shape:

_root.createEmptyMovieClip("test",1);
with (test) {
loadMovie("shape.swf");
}

The shape loads into the parent swf OK, and I can change the co-ordinates such
as _x _y and _xscale and _yscale. My problem is that I can't set a rollover for
the loaded swf.

_root.test.onRollOver = function () { trace("rolled over";}

doesn't seem to work. The shape swf is called from the same domain.

Any ideas?



inhswebdev
5/25/2004 1:08:00 AM
I think that the reason for this is because once a swf is loaded it replaces
all variables and functions within it's container. I think you'll find that if
you define your onRollOver inside of the swf that you're loading you'll have
much more success. Your _x, _y, _yscale, _xscale, etc are all properties and
are available regardless. I hope that makes sence :).

Mike
kglad
5/25/2004 1:36:56 AM
AddThis Social Bookmark Button