Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 18-05-2007, 22:08   #1 (permalink)
flashi
 
Registriert seit: Jul 2004
Beiträge: 45
Mausverfolger mit Blickrichtung zum Cursor

Hi,

damit habe ich einen Mausverfolger bebaut. Jeder Part für sich funktioniert prima.

Part 1. Mausverfolgung
Part 2. Rotation

onClipEvent(enterFrame) {

this._x = this._x+this._xmouse/60;
this._y = this._y+this._ymouse/60;

rotation_num=Math.atan2(this._ymouse-this._y,this._xmouse-this._x)*180/Math.PI;
this._rotation=Math.round(rotation_num) + 90;
trace(rotation_num + " - "+ this._x + " - "+ this._y);
}

Wenn ich beides vermische läuft mir das Objekt weg. Ich möchte aber, dass es immer die Blickrichtung zum Mauscursor hat und sich diesem annähert.

Danke und Gruß
thebook ist offline   Mit Zitat antworten
Alt 19-05-2007, 10:36   #2 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
Hi,
ClipEvents sind out . Aber was soll's:
PHP-Code:
onClipEvent (enterFrame) {
    
this._x += (_root._xmouse-this._x)/60;
    
this._y += (_root._ymouse-this._y)/60;
    
rotation_num Math.atan2(_root._ymouse-this._y_root._xmouse-this._x)*180/Math.PI;
    
this._rotation Math.round(rotation_num)+90
    
//trace(rotation_num+" - "+this._x+" - "+this._y);

__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager ist offline   Mit Zitat antworten
Alt 20-05-2007, 12:56   #3 (permalink)
flashi
 
Registriert seit: Jul 2004
Beiträge: 45
Dank!

... danke für Deinen Tip und die Korrektur! In der neuen Version wird das ganze natürlich als Prototyp zusammengebaut. Der ClipEvent wird dann eh gestrichen, ging nur um die grundsätzliche Funktionalität.

Gruß
thebook ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 20:04 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele