Hello.
I have a movieclip with instance name linkholder, on the root of the movie. In this, I had this code so that the movieclip worked as a infinit menu:
onClipEvent(load) {
var xcenter = _root.mask._x+_root.mask._width/2;
var speed = 2/10;
var begX = _root.mask._x;
}
onClipEvent(enterFrame) {
var endX = _root.mask._x+(_root.mask._width - 150);
//scroll starts from 0 at every gallery
this._x = begX;
}
if (_root.mask.hitTest(_root._xmouse, _root._ymouse)) {
var distance = _root._xmouse-xcenter;
this._x -= (distance*speed);
if (this._x>=begX) {
this._x = begX;
}
if (this._x<=endX) {
this._x = endX;
}
} else {
}
}
This infinite menu worked, though I want the code outside the MC, so I put this code on a layer outside linkholder:
_root.linkholder.onLoad = function(){
var xcenter = _root.mask._x+_root.mask._width/2;
var speed = 2/10;
var begX = _root.mask._x;
}
_root.linkholder.onEnterFrame = function(){
var endX = _root.mask._x+(_root.mask._width - 150);
//scroller starts from 0 at every gallery
_root.linkholder._x = begX;
if (_root.mask.hitTest(_root._xmouse, _root._ymouse)) {
var distance = _root._xmouse-xcenter;
_root.linkholder._x -= (distance*speed);
if (_root.linkholder._x>=begX) {
_root.linkholder._x = begX;
}
if (_root.linkholder._x<=endX) {
_root.linkholder._x = endX;
}
} else {
}
}
Then the infinite menu stoped scrolling. the onEnterFrame function still runs correctly (checked with a trace wich was printed all the time). I guessed that there was something wrong with using this in the latter code, so I changed all this to _root.linkholder, but that didn’t help neither. can u help me?
regards, henxon