Zurück   Flashforum > Flash > Flash Fortgeschritten > Flash 8

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 25-11-2007, 23:28   #1 (permalink)
Neuer User
 
Registriert seit: Nov 2007
Beiträge: 75
Question Einfache Frage zu Drag & Drop

Während der Anfasser_mc verschoben wird, soll gleichzeitig ein anderer Movieclip._mc verschoben werden. wie integriert man das in folgendes AS?:

Anfasser_mc.onPress = function (){
startDrag(this._parent, false, -106, -35, 76, 79)
}
Anfasser_mc.onRelease = function (){
stopDrag();
}

und wie setzt man den Anfasser_mc durch btn.onPress wieder auf seine ausgangsposition?

Geändert von voulontine (25-11-2007 um 23:31 Uhr)
voulontine ist offline   Mit Zitat antworten
Alt 25-11-2007, 23:31   #2 (permalink)
_gir
 
Benutzerbild von supasuka
 
Registriert seit: Jul 2006
Ort: Karlsruhe
Beiträge: 957
und weiter?
__________________
Gruß, Simon

swblog* | Invader Zim
supasuka ist offline   Mit Zitat antworten
Alt 25-11-2007, 23:35   #3 (permalink)
Neuer User
 
Registriert seit: Nov 2007
Beiträge: 75
war grad am bearbeiten des beitrags, als du geantwortet hast
voulontine ist offline   Mit Zitat antworten
Alt 25-11-2007, 23:40   #4 (permalink)
_gir
 
Benutzerbild von supasuka
 
Registriert seit: Jul 2006
Ort: Karlsruhe
Beiträge: 957
=) Da war ich aber schnell.
Um ihn zur Anfangspostion zurückzusetzten einfach die _x und _y am Anfang auslesen und dann wieder zuweisen.

PHP-Code:
var x:Number
var y:Number
Anfasser_mc
.onPress = function (){
startDrag(this._parentfalse, -106, -357679
x=this._y
y
=this._y

}
Anfasser_mc.onRelease = function (){
stopDrag();
this._x=x
this
._y=y

Das mit dem anderen Mc versteh ich nicht so ganz...
Du kannst mit startDrag nur EINEN Mc + Inhalte zur gleichen Zeit bewegen. Wenn du in Abhängigkeit von Anfasser_Mc's Position noch einen anderen Clip bewegen willst dann über ein onEnterFrame() Event.
__________________
Gruß, Simon

swblog* | Invader Zim
supasuka ist offline   Mit Zitat antworten
Alt 25-11-2007, 23:47   #5 (permalink)
Neuer User
 
Registriert seit: Nov 2007
Beiträge: 75
ich meine zweiteres. der zweite movieclip soll in abhängigkeit vom ersten mitgezogen werden...wie schreibt man das da? so?:

Anfasser_mc.onPress = function (){
startDrag(this._parent, false, -106, -35, 76, 79);
}
Anfasser_mc.onRelease = function (){
stopDrag();

Anfasser_mc.onEnterFrame() {

if (Anfasser_mc.startDrag) {
Movieclip2.startDrag;
}
}

Geändert von voulontine (25-11-2007 um 23:56 Uhr)
voulontine ist offline   Mit Zitat antworten
Alt 25-11-2007, 23:59   #6 (permalink)
Neuer User
 
Registriert seit: Nov 2007
Beiträge: 75
nee...so gehts nicht simon wo bist du???
voulontine ist offline   Mit Zitat antworten
Alt 26-11-2007, 00:03   #7 (permalink)
Neuer User
 
Registriert seit: Nov 2007
Beiträge: 75
Anfasser_mc.onEnterFrame = function (){
if (Anfasser.startDrag) {
_parent.Map_mc.Afrikapfad2_mc.startDrag;
}

und so geht es auch nicht
voulontine ist offline   Mit Zitat antworten
Alt 26-11-2007, 00:10   #8 (permalink)
_gir
 
Benutzerbild von supasuka
 
Registriert seit: Jul 2006
Ort: Karlsruhe
Beiträge: 957
So kann man es machen:

PHP-Code:
_global.display=this
//
mc.onPress = function () {
    
this.startDrag ();
    
this.onEnterFrame = function () {
        
display.follow._x this._x 100;
        
display.follow._y this._y 50;
        
this.updateAfterEvent ();
    };
};
mc.onRelease mc.onReleaseOutside = function () {
    
this.stopDrag ();
    
delete this.onEnterFrame;
}; 
Zwei MovieClips mit Namen "mc" und "follow" auf die Bühne und das Script in den ersten Frame der Hauptzeitleiste.
Schaus dir mal genau an und probier ein bisschen rum, du musst das Grundprinzip der Dinge die du proggst schon verstehen, sonst hast du immer wieder Probleme.
__________________
Gruß, Simon

swblog* | Invader Zim

Geändert von supasuka (26-11-2007 um 00:12 Uhr)
supasuka 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 22:53 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele