setProperty
기능은 다음과 같이 사용됩니다 그 이름은 코드에서 직접했던 것과 같습니다.
은 타임 라인 내에서 개체를 얻으려면 귀하의 경우에 당신이 할 수 있도록, 당신은 많은 매너 :
// In my case, the button1 object is inside the root timeline
on (release) {
// you can use some traces to more understand
trace(_parent); // gives : _level0
trace(this._parent); // gives : _level0
// this._parent is the same as _parent inside the timeline of our object
trace(this); // gives : _level0.button1
// if you want to use the name of your object inside its timeline, you have to use it on reference with its parent
trace(this._parent[this._name]); // gives : _level0.button1
trace(this._parent['button1']); // gives : _level0.button1
trace(this._parent.button1); // gives : _level0.button1
// then you can pick a choice between all these notation :
var _this = this._parent['button1'];// this, this._parent[this._name] or this._parent.button1
// to hide the object using setProperty
setProperty(_this, _visible, false);
// or simply without setProperty
_this._visible = false;
}
을 그리고 당신은 개체의 parent
의 타임 라인 안에있는 경우, 당신은 할 수 있습니다 :
button1.onRelease = function():Void {
// to hide the object using setProperty, you can do
setProperty(this, _visible, false);
// or (selected by its name)
setProperty(this._name, _visible, false);
// or (selected by its name)
setProperty('button1', _visible, false);
// or
setProperty(button1, _visible, false);
// or simply without setProperty
this._visible = false;
// or
button1._visible = false;
// or, using its name
this._parent[this._name]._visible = false;
this._parent['button1']._visible = false;
this._parent[button1]._visible = false;
}
내 대답은 짧을 수도 있지만 더 명확하게 이해하려고 노력했습니다.
희망이 도움이 될 수 있습니다.