[ascoders] Re: oop frage - zugriff auf mc's
- From: Volker Kreß <kress@xxxxxxxxxx>
- To: ascoders@xxxxxxxxxxxxx
- Date: Fri, 31 Oct 2003 14:03:24 +0100
Hallo,
versuch ma
ScrollObj.slider prototype.onPress = …
dann gehts
Besser noch vergiss Object.registerclass für dynamische Mc und nutz
einfach eine Verrebung. So kannst du verschiedene Klassen auf einen Mc
anwenden.
ich weiss nicht mehr wers gepostet hat
// ####################################################
// Ermöglicht dynamisches setzen von Klassen für Mcs
// in der Laufzeit
// ####################################################
MovieClip.prototype.setClass = function(class){
var c = typeof(eval(class).prototype.hitTest)
// check ob die übergebene Klasse die "build-in"
// MovieClip Methoden enthält
if(c == "function"){
this.__proto__ = eval(class).prototype
}
};
Volker
Am Freitag, 31.10.03 um 13:53 Uhr schrieb Gesa.Boettcher@xxxxxxxx:
nochmal hallo,
ich erstelle folgendes:
ScrollObj = function (x, y, sy, by) {
this._x = this.x;
this._y = this.y;
this.slider._y = this.sy;
this.butUp._y = this.by;
}
ScrollObj.prototype = new MovieClip();
Object.registerClass("scrollSymbol",ScrollObj);
attachMovie("scrollSymbol", "scrollCont", 2, {x: 368, y: 331, sy: 13,
by:
348});
-------------
nun liegt in dem scrollSymbol der mc "slider" - es geht darum, wie ich
den
jetzt ansprechen kann?
ScrollObj = function (x, y, sy, by) {
this._x = this.x;
this._y = this.y;
this.slider._y = this.sy;
this.butUp._y = this.by;
this.slider.onPress = ......
}
das geht, kommt mir aber nicht sehr elegant vor (selbst wenn ich die
eigentliche arbeit auslagern kann).
aber
ScrollObj.prototype.slider.onPress = ..... o.ä.
funktioniert nicht
slider müßte doch jetzt teil von ScrollObj "scrollCont" sein
und somit in allen instanzen vorhanden/verfügbar - also auch
ansprechbar -
sein??
oder stelle ich mir das völlig falsch vor?
gesa
------------------------------------------------------
Archiv : http://www.freelists.org/archives/ascoders/
Optionen : http://www.freelists.org/list/ascoders
------------------------------------------------------
Mit freundlichen Grüßen aus Wuppertal
Volker Kreß
/------------------------------------------------
uscreen gmbh
Volker Kreß
Tel. 0202.244988-20
Fax. 0202.244988-11
www.uscreen.de
kress@uscreen
/-----------------------------------------------
/ T E S T E N S I E S I T E F R U I T
/------------------------------------------------
http://asp.siteFruit.net
Login: demo
Passwort: demo
-----------------------------------------------/
------------------------------------------------------
Archiv : http://www.freelists.org/archives/ascoders/
Optionen : http://www.freelists.org/list/ascoders
------------------------------------------------------
- References:
- [ascoders] oop frage - zugriff auf mc's
- From: Gesa . Boettcher
Other related posts:
- » [ascoders] oop frage - zugriff auf mc's
- » [ascoders] Re: oop frage - zugriff auf mc's
- » [ascoders] Re: oop frage - zugriff auf mc's
- » [ascoders] Re: oop frage - zugriff auf mc's
- » [ascoders] Re: oop frage - zugriff auf mc's
- » [ascoders] Re: oop frage - zugriff auf mc's
- » [ascoders] Re: oop frage - zugriff auf mc's
- » [ascoders] Re: oop frage - zugriff auf mc's
nochmal hallo,
ich erstelle folgendes:
ScrollObj = function (x, y, sy, by) {
this._x = this.x;
this._y = this.y;
this.slider._y = this.sy;
this.butUp._y = this.by;
}ScrollObj.prototype = new MovieClip();
Object.registerClass("scrollSymbol",ScrollObj);attachMovie("scrollSymbol", "scrollCont", 2, {x: 368, y: 331, sy: 13, by:
348});
-------------
nun liegt in dem scrollSymbol der mc "slider" - es geht darum, wie ich den
jetzt ansprechen kann?
ScrollObj = function (x, y, sy, by) {
this._x = this.x;
this._y = this.y;
this.slider._y = this.sy;
this.butUp._y = this.by;this.slider.onPress = ...... }
das geht, kommt mir aber nicht sehr elegant vor (selbst wenn ich die eigentliche arbeit auslagern kann).
aber ScrollObj.prototype.slider.onPress = ..... o.ä. funktioniert nicht
slider müßte doch jetzt teil von ScrollObj "scrollCont" sein
und somit in allen instanzen vorhanden/verfügbar - also auch ansprechbar -
sein??
oder stelle ich mir das völlig falsch vor?
gesa
------------------------------------------------------ Archiv : http://www.freelists.org/archives/ascoders/ Optionen : http://www.freelists.org/list/ascoders ------------------------------------------------------
- [ascoders] oop frage - zugriff auf mc's
- From: Gesa . Boettcher