all groups > flash actionscript > june 2005 >
You're in the

flash actionscript

group:

problem with slideTo()


problem with slideTo() doof moof
6/9/2005 11:52:05 PM
flash actionscript: can anyone tell me what could be wrong with this script:

#include "lmc_tween.as"
this.my_btn.onRollOver = function(){
this.my_mc.slideTo(30, 30, 5);
}
the slideto works just on its own but when put into the onrollover method it
does nothing. i no this is basic but any help will be much appriciated. thanx
in advance.
Re: problem with slideTo() kglad
6/10/2005 1:17:14 AM
Re: problem with slideTo() kglad
6/13/2005 12:00:00 AM
here's how to debug:

trace("outside handler this= "+this);
this.btn1.onRollOver = function() {
trace("inside handler this= "+this);
this.my_mc.slideTo(30, 30, 5);
};

you'll see the results in the output panel and should be able to deduce that
you need to eliminate this.my_mc unless my_mc is a child of this.btn1. if you
think my_mc is a child of btn1, you could double check by using:

trace("outside handler this= "+this);
this.btn1.onRollOver = function() {
trace("inside handler this= "+this);
this.my_mc.slideTo(30, 30, 5);
trace("this.my_mc= "+this.my_mc);
trace(my_mc);
};

my guess is this.my_mc is undefined and trace(my_mc) will reveal the timeline
that contains that code followed by my_mc. if trace(my_mc) is also undefined
you have an incorrect movieclip name or you need a path reference to find
my_mc. you can always place a trace(this) statement on my_mc's timeline to see
its path.

anyway, to remedy my guess is just need to use:

this.my_btn.onRollOver = function(){
my_mc.slideTo(30, 30, 5);
}
Re: problem with slideTo() doof moof
6/13/2005 12:00:00 AM
thank you so much for you speedy replys.

your suggestions have worked a treat and you have taught me a new skill and
saved me reworking my whole app to get around this problem. for this i am very
greatfull. i have saved your advice for reference and am sure i will refer to
it untill i know how to do it. keep up the good work mate.
Re: problem with slideTo() doof moof
6/13/2005 1:05:19 PM
firstly thanx for replying. i didn't realise the difference which you pointed
out. my next question is then how do i use the trace to debug this? also, will
using the target tool with the curser on a line inside the function give the
correct script?
Re: problem with slideTo() kglad
6/14/2005 12:00:00 AM
AddThis Social Bookmark Button