NEU: Alle Visual Codes als Code Snippets für Flash CS5:
jetzt hier downloaden .
Slider
Code Actionscript 2.0
Instanz-Aktion
on (press) {
mousepressed = 1;
}
on (release, releaseOutside) {
mousepressed = 0;
}
onClipEvent (enterFrame) {
if (mousepressed == 1) {
this._y = _root._ymouse;
output = (_root._ymouse) / 4;
_parent.square1._alpha = output;
_parent.square2._alpha = 100 - output;
}
}
Code Actionscript 3.0
addEventListener(Event.ENTER_FRAME, enterFrame); stage.addEventListener(MouseEvent.MOUSE_UP, releaseOutside); slider.addEventListener(MouseEvent.MOUSE_DOWN, press); slider.addEventListener(MouseEvent.MOUSE_UP, release); var mousepressed = 0; function press(e:MouseEvent) { mousepressed = 1; } function release(e:MouseEvent){ mousepressed = 0; } function releaseOutside(e:MouseEvent) { mousepressed = 0; } function enterFrame(event:Event) { if (mousepressed == 1) { slider.y = mouseY; var output = (mouseY) / 400; box1.alpha = output; box2.alpha = 1 - output; } }
Infos
Durch Bewegen des Sliders kann der Benutzer einen Wert kontinuierlich verändern, z.B. hier die Deckkraft alpha der zwei Quadrate.
verwandt mit: Maus Position, Scrollbox
Download
Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File