Using a tweening function as a rollover.  Please help me restore functionality!

Ok, I have a movieclip with 3 different tweens applied to it
by a few functions. The first tween happens on rollover and makes
the movieclip a little bigger, the second tween happens on rollout
and makes it smaller. The third tween happens on release and makes
the clip much bigger. However, when the user clicks the movie clip
it deletes all of the rollover/rollout/onrelease commands so that
the user can interact with a swf which is loaded into the mc.
Here's my code so far:
//Tweens//
function grow(who) {
who.onEnterFrame = function() {
if (this._xscale<40) {
this._xscale += 5;
this._yscale += 5;
if (this._xscale == 40 && this._yscale == 40) {
delete this.onEnterFrame;
function shrink(who) {
who.onEnterFrame = function() {
if (this._xscale>16.5) {
this._xscale -= 5;
this._yscale -= 5;
if (this._xscale == 16.5 && this._yscale == 16.5) {
delete this.onEnterFrame;
function growBigger(who) {
who.onEnterFrame = function() {
if (this._xscale<100) {
this._xscale += 5;
this._yscale += 5;
if (this._xscale == 100 && this._yscale == 100) {
delete this.onEnterFrame;
//End Tweens//
loadMovie("preloader.swf", "preloader_mc");
preloader_mc._xscale = 21;
preloader_mc._yscale = 20;
this.onRollOver = function() {
grow(this);
this.onRollOut = function() {
shrink(this);
this.onRelease = function() {
delete onRollOver;
delete onRollOut;
delete onRelease;
_root.MkXpos = _root.touristsMark._x;
_root.MkYpos = _root.touristsMark._y;
_root.pan(_root.mapContainer_mc);
growBigger(this);
_root.mapContainer_mc.map_mc.dragger_mc._visible = false;
_root.drag = false;
All of this works just fine. My only problem is that when the
user exits the loaded swf I want the button to shrink back down and
have its functionality restored. Basically when someone clicks the
exit button on the external swf it runs the shrink(who) function
and shrinks everything back down. I put a line of code into the
shrink function when it checks to see if "who" is at 16.5, which
looked like this:
if (this._xscale == 16.5 && this._yscale == 16.5) {
this.onRollOver = function = () {
grow(this);
delete this.onEnterFrame;
However, that didn't restore the functionality. Any help
would be greatly appreciated! I'm a poor student on a deadline

I'm such a moron. I never put in a trace command to see if
the last line of my shrink command was getting executed. It turns
out the movie doesn't scale perfectly to 16.5 but instead goes to
16.49etcetc. As a result that last line wasn't being executed. Now
everything works. But I was wondering if you guys could think of a
nice way to compartmentalize all of this code, like maybe store it
all in a variable or something, so I can attach it to several
different movie clips?

Similar Messages

Maybe you are looking for

  • Planning Version Table

    Hi SAP Gurus, I would like to inquire what particular table in SAP R/3 that can display list of planning version created for a specific material and plant using data element VRSIO. Planning version is created in tcode MC93 Thanks, Patrick

  • Adding selection parameter in VF04 selection screen

    Hi Gurus... I need to add a selection parameter on selection screen of VF04 transaction. Is it possible to do so? If yes, please tell me how. Thanks.

  • Which class, Spring Framework or Web Aervices with Java?

    So, I hope it's okay to post this type of question here. I'm trying to figure out which would be better to take, a 4-day course from SpringSource on the core capabilities of the Spring Framework, or a 4-day course on building web services with Java?

  • Panel short in KDL-50EX645

    I purchased a KDL-50EX645 Bravia TV a little over 2 years ago. My wife and I rarely watch more than 8 hours per week. Several weeks ago it wouldn't turn on and I took it to the local authorized Sony repair office and they told me that there was a sho

  • Can I edit Keynote Template?

    I use Keynote 08 to create flash banners for my websites. I want to use one of the templates for a particular banner but it has some elements in it that I don't want. Is there a way I can make that template editable so I can remove two of the graphic