winfreebot
01-25-2006, 01:43 PM
Hey guys,
I have two methods that I thought would be infinitely called (since both called onEnterFrame) until deleted and each appears below.
Is there a difference between calling methods in a _root.onEnterFrame = function() and calling them using instanceName.onEnterFrame = methodName;?
Because the updateImage() method turns off when I leave the frame and the other seems to require deletion to turn off. However, I'd like updateImage() to run forever...do I just need to swap how they are called or should they be running similarly already?
//---------------onEnterFrame------------------------------------//
_root.onEnterFrame = function()
{
trace("updateImage()");
photoFrame1.updateImage();
};
//-----------------------------------------------------------------//
//-------------------lights----------------------------------------//
showLamp = function()
{
lamp_start_x = 477;
lamp_start_y = 174;
l = attachMovie("LampPost", "lamppost", 10);
l._x = lamp_start_x;
l._y = lamp_start_y;
l.onEnterFrame = flicker;
};
I have two methods that I thought would be infinitely called (since both called onEnterFrame) until deleted and each appears below.
Is there a difference between calling methods in a _root.onEnterFrame = function() and calling them using instanceName.onEnterFrame = methodName;?
Because the updateImage() method turns off when I leave the frame and the other seems to require deletion to turn off. However, I'd like updateImage() to run forever...do I just need to swap how they are called or should they be running similarly already?
//---------------onEnterFrame------------------------------------//
_root.onEnterFrame = function()
{
trace("updateImage()");
photoFrame1.updateImage();
};
//-----------------------------------------------------------------//
//-------------------lights----------------------------------------//
showLamp = function()
{
lamp_start_x = 477;
lamp_start_y = 174;
l = attachMovie("LampPost", "lamppost", 10);
l._x = lamp_start_x;
l._y = lamp_start_y;
l.onEnterFrame = flicker;
};