Need to buildin a speed variable

peepz,

i have a script to scroll a background image, but i want to buildin a speed variable, so i can adjust it. i declared one but i need to use it somewhere. hope you can help!


stop();

blaat = function(mc)
{
 this._parent.onLoad = function()
 {
  trace(mc._width);
  
  yoff = 10;
  xoff = 10;
  mheight = 300;
  mwidth = 900;
  iheight = mc._height;
  iwidth = mc._width;
  
  // trace ("iwidth: " + iwidth + ", iheight: " + iheight);
  qwidth = (iwidth-mwidth)/mwidth;
  qheight = (iheight-mheight)/mheight;
  // trace ("qwidth: " + qwidth + ", qheight: " + qheight);
  speedx = 10;
  speedy = 10;
 }
 this._parent.onEnterFrame = function()
 {
  // trace ("im***: " + image._y);
  mousex = _root._xmouse-xoff-mwidth/2;
  mousey = _root._ymouse-yoff-mheight/2;
  
  if (mousey<-mheight/2) {
   mousey = -mheight/2;
  }
  if (mousey>mheight/2) {
   mousey = mheight/2;
  }
  if (mousex<-mwidth/2+20) {
   mousex = -mwidth/2;
  }
  if (mousex>mwidth/2-20) {
   mousex = mwidth/2;
  }
  targety = (-qheight*mousey+mheight/2+yoff);
  mc._y += Math.floor((targety-mc._y)/10);
  targetx = -qwidth*mousex+mwidth/2+xoff;
  mc._x += Math.floor((targetx-mc._x)/10);
 }
}

blaat(mcBG);