# \[FMX\] AS LoadMovie Revisited

**URL:** https://forum.kirupa.com/t/fmx-as-loadmovie-revisited/43903
**Category:** flash
**Created:** [February 26, 2004, 11:37pm UTC](https://forum.kirupa.com/t/fmx-as-loadmovie-revisited/43903 "2004-02-26T23:37:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![w1cked5mile](https://avatars.discourse-cdn.com/v4/letter/w/b2d939/32.png) [@w1cked5mile](https://forum.kirupa.com/u/w1cked5mile)
#### Post date: [February 26, 2004, 11:37pm UTC](https://forum.kirupa.com/t/fmx-as-loadmovie-revisited/43903/1 "2004-02-26T23:37:00Z")

</div>

Hello to everyone. Long time listener, first time caller.

I preface this with the disclaimer that I’m new to flash and actionscript and I’ve read the tutorials on this site and others regarding depths, levels, this, and loadmovie.

I have a problem with scope I believe in some AS while using the loadmovie() function. I am loading multiple instances (5) of the the same .swf on \_level0 of my main movieclip using createEmptyMovieClip and LoadMovie. When I play the main MC the loaded swfs complete thier initial animation but do not respond to onrollover events.

Here’s the AS for the main MC:

movieclip.prototype.scaleMC = function (scl) {  
this.\_xscale = scl;  
this.\_yscale = scl;  
};  
createEmptyMovieClip(“menuItem1”, 1);  
menuItem1.loadMovie(“menuItem.swf”, 0);  
menuItem1.\_x = -120;  
menuItem1.\_y = 0;  
createEmptyMovieClip(“menuItem2”, 2);  
menuItem2.loadMovie(“menuItem.swf”, 0);  
menuItem2.\_x = -60;  
menuItem2.\_y = -5;  
menuItem2.scaleMC(90);  
createEmptyMovieClip(“menuItem3”, 3);  
menuItem3.loadMovie(“menuItem.swf”, 0);  
menuItem3.\_x = 0;  
menuItem3.\_y = -10;  
menuItem3.scaleMC(80);  
createEmptyMovieClip(“menuItem4”, 4);  
menuItem4.loadMovie(“menuItem.swf”, 0);  
menuItem4.\_x = 60;  
menuItem4.\_y = -15;  
menuItem4.scaleMC(70);  
createEmptyMovieClip(“menuItem5”, 5);  
menuItem5.loadMovie(“menuItem.swf”, 0);  
menuItem5.\_x = 120;  
menuItem5.\_y = -20;  
menuItem5.scaleMC(60);

Here’s the AS for the loaded MC:

MovieClip.prototype.EaseY = function(y\_target) {  
var a, t, y\_value, b, acc, drag, vx, vy;  
a = 15;  
t = 100;  
b = 1.6;  
y\_value = this.\_y;  
acc = 5;  
drag = false;  
this.onenterframe = function() {  
y\_value += vy;  
vy = (vy+((y\_target-y\_value)/acc))/b;  
if (this.\_y=y\_target) {  
this.\_y = y\_value;  
}  
};  
};  
MovieClip.prototype.EaseYRef = function(y\_target) {  
var a, t, y\_value, b, acc, drag, vx, vy;  
a = 15;  
t = 100;  
b = 1.6;  
y\_value = this.\_y;  
acc = 5;  
drag = false;  
this.onenterframe = function() {  
y\_value += vy;  
vy = (vy+((y\_target-y\_value)/acc))/b;  
if (this.\_y=y\_target) {  
this.\_y = y\_value;  
}  
};  
};  
MovieClip.prototype.shadow = function(y\_pos, ref\_pos) {  
this.onrollOver = function() {  
adjY = mass.\_y-25;  
adjYref = massref.\_y+25;  
this.mass.easeY(adjY);  
this.massref.easeYref(adjYref);  
};  
this.onrollout = function() {  
this.mass.easeY(y\_pos);  
this.massref.easeYref(ref\_pos);  
};  
};

I know it has to do with the scope of the onrollover function and onrollout function but I can’t quite put my finger on it. Can someone please help?

Thank you!
