Auf Anfrage ein kleines Script inkl. BSP-Datei.
PHP-Code:
/*
Mit diesem Script könnt ihr mit einem MovieClip (Filmsequenz) eine
Schaltfläche simmulieren.
netTrek.de
*/
// onPress
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
trace("auf MC wurde geklickt")
this.gotoAndStop("click")
}
}
// onRelease
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
trace("auf MC wurde losgelassen")
this.gotoAndStop("over")
}
}
// onRollOver
onClipEvent (mouseMove) {
if (this.hitTest(_root._xmouse, _root._ymouse) && !over) {
over=true
trace("Maus ist jetzt auf MC")
this.gotoAndStop("over")
}
}
// onRollOut
onClipEvent (mouseMove) {
if (!this.hitTest(_root._xmouse, _root._ymouse) && over) {
over=false
trace("Maus hat MC verlasse")
this.gotoAndStop("normal")
}
}
kleine Verbesserung!
Damit spart man sich ein clipEvent...
PHP-Code:
/*
kleine Verbesserung
*/
// onPress
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
trace("auf MC wurde geklickt")
this.gotoAndStop("click")
}
}
// onRelease
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
trace("auf MC wurde losgelassen")
this.gotoAndStop("over")
}
}
// onRollOver
onClipEvent (mouseMove) {
if (this.hitTest(_root._xmouse, _root._ymouse)) {
if(!over){
over=true
trace("Maus ist jetzt auf MC")
this.gotoAndStop("over")
}
} else{
// onRollOut
if(over){
over=false
trace("Maus hat MC verlasse")
this.gotoAndStop("normal")
}
}
}
SABAN