Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 13-01-2007, 13:27   #1 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 4
Problem mit Panorama

Hallo zusammen,

habe ein Problem bei meiner Panorama-Funktion....
Sie funktioniert zwar so wie sie hier steht, aber ich möchte eigentlich, dass der Panorama-Effekt nur dann "aufgerufen" wird, wenn man mit der Maus in die Seitenbereiche des Bildes kommt. Im Moment steht das Bild bei Bewegung des Mauszeigers nur an einem einzigem Punkt still, nämlich dem Mittelpunkt der Bühne.

Kann mir da jemand weiterhelfen?
Danke sehr!

Hier ist das Script:
----------------------------------


function panorama(obj) {
obj.xmittelpunkt = 400;
obj.ymittelpunkt = 300;
geschwindigkeit = 10;
obj.xrandPunkt = (obj.xmittelpunkt*2) - obj._width;
obj.yrandPunkt = (obj.ymittelpunkt*2) - obj._height;

obj.onEnterFrame = function() {

this._x += (this.xmittelpunkt - this._parent._xmouse) / geschwindigkeit;
this._y += (this.ymittelpunkt - this._parent._ymouse) / geschwindigkeit;

if (this._x < obj.xrandPunkt) {
this._x = obj.xrandPunkt;
}
if (this._x > 0) {
this._x = 0;
}

if (this._y < obj.yrandPunkt) {
this._y = obj.yrandPunkt;
}
if (this._y > 0) {
this._y = 0;
}


};
}

panorama(bild);
Linus85 ist offline   Mit Zitat antworten
Alt 13-01-2007, 14:26   #2 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
PHP-Code:
function panorama(obj) {
    
obj.xmittelpunkt 400;
    
obj.ymittelpunkt 300;
    
geschwindigkeit 10;
    
obj.xrandPunkt = (obj.xmittelpunkt*2)-obj._width;
    
obj.yrandPunkt = (obj.ymittelpunkt*2)-obj._height;
    
obj.onRollOver = function() {
        
this.useHandCursor false;
        
this.onEnterFrame = function() {
            
this._x += (this.xmittelpunkt-this._parent._xmouse)/geschwindigkeit;
            
this._y += (this.ymittelpunkt-this._parent._ymouse)/geschwindigkeit;
            if (
this._x<obj.xrandPunkt) {
                
this._x obj.xrandPunkt;
            }
            if (
this._x>0) {
                
this._x 0;
            }
            if (
this._y<obj.yrandPunkt) {
                
this._y obj.yrandPunkt;
            }
            if (
this._y>0) {
                
this._y 0;
            }
        };
    };
    
obj.onRollOut = function() {
        
delete this.onEnterFrame;
    };
}
panorama(bild); 
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti 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 04:38 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele