Hopefooly
09-16-2003, 01:31 AM
ok, heres the code i have on the main stage, it is just to mess around and i was trying to learn a few things from my O'Rielly book by Colin Moock. I might just be missing it but heres the code with a following explanation of my problem.
this.createEmptyMovieClip("box", 1);
this.lineStyle(.25);
this.moveTo(100,100);
this.beginFill(0xFF0000);
this.lineTo(100,100);
this.lineTo(200,100);
this.lineTo(200,200);
this.lineTo(100,200);
this.endFill();
this.onLoad =function() {
this._alpha=100;
rate = 10;
}
this.onEnterFrame = function () {
if(this._alpha <5 || this._alpha >95) {
rate = -rate;
}
this._alpha += rate;
}
now when i change the this. reference to the instance name "box" it doesnt work. ive treid just box, _root.box, with the onLoad and onEnterFrame operators...and it wont work when i do it that way. it works as the way it is now...just want to know why it wont work otherwise.
this.createEmptyMovieClip("box", 1);
this.lineStyle(.25);
this.moveTo(100,100);
this.beginFill(0xFF0000);
this.lineTo(100,100);
this.lineTo(200,100);
this.lineTo(200,200);
this.lineTo(100,200);
this.endFill();
this.onLoad =function() {
this._alpha=100;
rate = 10;
}
this.onEnterFrame = function () {
if(this._alpha <5 || this._alpha >95) {
rate = -rate;
}
this._alpha += rate;
}
now when i change the this. reference to the instance name "box" it doesnt work. ive treid just box, _root.box, with the onLoad and onEnterFrame operators...and it wont work when i do it that way. it works as the way it is now...just want to know why it wont work otherwise.