Antworten auf deine Fragen:
Neues Thema erstellen

Antworten zum Thema „Dynamische Bewegung mit Verzögerung mit AS“

N

no_username

Guest

Hallo,

Ich möchte gerne wissen wie ich eine linie dynamisch (mit Verzögerung gegen Schluss) bewegen kann. Ich möchte, dass meine Funktion automatisch startet wenn der Keyframe aktiv wird. Warum das nicht geht weiss ich allerdings nicht....:(

Folgender Code habe ich im ersten Keyframe platziert:
Code:
function zoom(objekt, endgrösse) {
    _root.createEmptyMovieClip("zoomx1", 1);
    _root.zoomx1.moveTo(-2, 0);
    _root.zoomx1.lineStyle(2, 0x000000, 100);
    _root.zoomx1.lineTo(-2, 768);
    _root.zoomx1._x = _root.zoomx1._x+(800-_root.zoomx1._x)/6;
}
stop();
onEnterFrame = function () {
    zoom(0, 0);
    updateAfterEvent();
};
Ich habe bis jetzt erfolglos Hilfe gesucht (natürlich habe ich die Suche benutzt), doch dies sind Probleme die ich oftmals antreffe...obwohl es eigentlich nicht so schwer sein sollte...:hmpf: , weshalb ich dieses Topic gemacht habe.

Danke für eure Hilfe...
 

sokie

Mod | Web

AW: Dynamische Bewegung mit Verzögerung mit AS

jedes mal wenn ein nächster frame betreten wird erstellst du einen moviclip mit demselben namen in der selben tiefe mit dem selben inhalt an der selben position und rückst diesen ein stück nach rechts.

dabei sollte doch eigentlich bestimmt nur ein movieclip erstellt werden und dieser dann bewegt werden,oder?
etwas irreführend ist der bezechner zoom.
versuch mal zuerst den MC zu erstellen und den Inhalt zu zeichnen, und das ganze dann erst zu animeiren.
Code:
//mc erstellen:
    _root.createEmptyMovieClip("zoomx1", 1);
    _root.zoomx1.moveTo(-2, 0);
    _root.zoomx1.lineStyle(2, 0x000000, 100);
    _root.zoomx1.lineTo(-2, 768);

//mc animieren:

    var zielX = 800;
    
    zoomx1.onEnterFrame = function(){
        animiere();
    }
    function animiere(){
        this._x += (zielX - this._x)/16;
    }
 

4uwak

WEB?ViDEO?FOTO and more

AW: Dynamische Bewegung mit Verzögerung mit AS

mach doch einfach einen stink normalen tween mit ActionScript

Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;

mc.onRollOver = function() {
        var tweenY : Tween = new Tween(this, "_y", Strong.easeOut, this._y, 120, 10, false);
        
    };
 
N

no_username

Guest

AW: Dynamische Bewegung mit Verzögerung mit AS

Danke für eure schnellen Antworten...
eigentlich möchte ich in der Funktion ein objekt und dessen endgrösse angeben können, dann sollten linien kommen, das objekt anzoomen und es vergrössern...:D:D:D
fühle mich aber irgendwie auf dem Holzweg....:rolleyes:, habe irgendwie was zusammengeschrieben...
Code:
function zoom(objekt, endgrössex, endgrössey) {
    _root.createEmptyMovieClip("zoomx1", 1);
    _root.zoomx1.moveTo(-2, 0);
    _root.zoomx1.lineStyle(2, 0x000000, 100);
    _root.zoomx1.lineTo(-2, 768);
    _root.createEmptyMovieClip("zoomx2", 1);
    _root.zoomx2.moveTo(1024, 0);
    _root.zoomx2.lineStyle(2, 0x000000, 100);
    _root.zoomx2.lineTo(1024, 768);
    _root.createEmptyMovieClip("zoomy1", 1);
    _root.zoomy1.moveTo(0, -2);
    _root.zoomy1.lineStyle(2, 0x000000, 100);
    _root.zoomy1.lineTo(1024, -2);
    _root.createEmptyMovieClip("zoomy2", 1);
    _root.zoomy2.moveTo(768, 0);
    _root.zoomy2.lineStyle(2, 0x000000, 100);
    _root.zoomy2.lineTo(768, 1024);
    lines = 1;
    if (lines=1) {
        //die if schleifen habe ich erstellt, damit die bewegungen erst nachher in kraft treten..,
        _root.zoomx1._x = _root.zoomx1._x+(objekt._x-_root.zoomx1._x)/6;
        _root.zoomx2._x = _root.zoomx2._x+((objekt._width+objekt._x)-_root.zoomx2._x)/6;
        _root.zoomy1._y = _root.zoomy1._y+(objekt._y-_root.zoomx2._y)/6;
        _root.zoomy2._y = _root.zoomy2._y+((objekt._height+objekt._y)-_root.zoomy2._y)/6;
        objekt._x = _root.ox;
        objekt._y = _root.oy;
        objekt._width = _root.ow;
        objekt._height = _root.oh;
        //diese variablen hab ich erstellt, damit objekt._x etc. nicht variabel sind (/fix festgelegt sind)
        if (_root.zoomx1._x=objekt._x && _root.zoomy1._y) {
            lines = 2;
        }
    }
    if (lines=2) {
        objekt._x = _root.zoomx1._x;
        objekt._y = _root.zoomy1._y;
        objekt._width = _root.zoomx2._x-objekt._x;
        objekt._height = _root.zoomy2._y-objekt._y;
        //punkte der ecken in Variable festlegen:
        gx = ox+ow;
        ax = (1024-endgrösse)/2;
        bx = ax+endgrössex;
        cx = gx+((bx-gx)/2);
        dx = ax+((ox-ax)/2);
        gy = oy;
        Iy = oh+oy;
        by = (768-endgrössey)/2;
        Jy = by+endgrössey;
        ey = by+((oy-by)/2);
        fy = Iy+((Jy-Iy)/2);
        _root.zoomx1._x += ((ax-_root.zoomx1._x)/(6));//hier möchte ich eigentlich eine umgekehrte verzögerung
        _root.zoomx2._x += ((bx-_root.zoomx2._x)/(6));//"ease in" erzeugen, doch ich fand nicht heraus wie...
        _root.zoomy1._y += ((by-_root.zoomy1._y)/(6));
        _root.zoomy2._y += ((Jy-_root.zoomy2._y)/(6));
        if (_root.zoomx1._x=dx) {
            lines = 3;
        }
    }
    if (lines=3) {
        objekt._x = _root.zoomx1._x;
        objekt._y = _root.zoomy1._y;
        objekt._width = _root.zoomx2._x-objekt._x;
        objekt._height = _root.zoomy2._y-objekt._y;
        gx = ox+ow;
        ax = (1024-endgrösse)/2;
        bx = ax+endgrössex;
        cx = gx+((bx-gx)/2);
        dx = ax+((ox-ax)/2);
        gy = oy;
        Iy = oh+oy;
        by = (768-endgrössey)/2;
        Jy = by+endgrössey;
        ey = by+((oy-by)/2);
        fy = Iy+((Jy-Iy)/2);
        _root.zoomx1._x += ((ax-_root.zoomx1._x)/6);
        _root.zoomx2._x += ((bx-_root.zoomx2._x)/6);
        _root.zoomy1._y += ((by-_root.zoomy2._y)/6);
        _root.zoomy2._y += ((Jy-_root.zoomy2._y)/6);
    }
}
klar?;)

HILFT mir jetzt niemand mehr???!?
 
Zuletzt bearbeitet von einem Moderator:
N

no_username

Guest

AW: Dynamische Bewegung mit Verzögerung mit AS

Ist das Ganze jetzt zu kompliziert oder bin ich völlig neben den Schuhen, dass mir niemand hilft?!?
 
Bilder bitte hier hochladen und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Antworten auf deine Fragen:
Neues Thema erstellen

Willkommen auf PSD-Tutorials.de

In unseren Foren vernetzt du dich mit anderen Personen, um dich rund um die Themen Fotografie, Grafik, Gestaltung, Bildbearbeitung und 3D auszutauschen. Außerdem schalten wir für dich regelmäßig kostenlose Inhalte frei. Liebe Grüße senden dir die PSD-Gründer Stefan und Matthias Petri aus Waren an der Müritz. Hier erfährst du mehr über uns.

Stefan und Matthias Petri von PSD-Tutorials.de

Nächster neuer Gratisinhalt

03
Stunden
:
:
25
Minuten
:
:
19
Sekunden

Neueste Themen & Antworten

Flatrate für Tutorials, Assets, Vorlagen

Zurzeit aktive Besucher

Statistik des Forums

Themen
175.182
Beiträge
2.582.045
Mitglieder
67.255
Neuestes Mitglied
Bitterlimoni
Oben