Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 28-07-2004, 08:41   #1 (permalink)
Neuer User
 
Registriert seit: Jul 2004
Beiträge: 20
Question Einfach für euch!!!

Hallo brauche Hilfe von euch Actionscript-Checkern,

und zwar will ich einen externe swf in einen Drop laden, der Drop befindet sich schon sichtbar auf der Bühne. Die geladene swf übergibt nun die Neue Position des Drops
Code:
_level0._root.drop._x=200
_level0._root.drop._y=200

Jetzt springt der Drop auf die neue x und y Position.
Ich will aber das der Drop sich in einer flüssigen Bewegung dort hin bewegt,
quasi wie n Tween!!!
Kann man das so umsetzen, das die externen swfs jeweils den Code enthalten?
Wenn ja wie lautet dieser?

Recht herzlichen Dank
finju ist offline   Mit Zitat antworten
Alt 28-07-2004, 09:04   #2 (permalink)
Flashaholic
 
Benutzerbild von atothek
 
Registriert seit: Feb 2003
Ort: Berlin
Beiträge: 1.459
hier hab ich mal nen einfachen prototype basierend auf robert penners Math easy equations.


PHP-Code:
/*
* t==timeline/timebase/framenr
* b==begin/statvalue
* c==course/strecke/oiginal+c
* d==duration/dauer
*/

/*
* robert penner easy equations
*/
_global.easeIn=function(tbcd) {
    return (
== 0) ? c*Math.pow(210*(t/d-1))+b;
}
_global.easeOut=function(tbcd) {
    return (
== d) ? b+c*(-Math.pow(2, -10*t/d)+1)+b;
}
_global.easeInOut=function(tbcd) {
    if (
== 0) return b;
    if (
== d) return b+c;
    if ((
/= d/2)<1)return c/2*Math.pow(210*(t-1))+b;
    return 
c/2*(-Math.pow(2, -10*--t)+2)+b;
}

/* neuer prototype zum sliden */
MovieClip.prototype.slideTo = function(pTargetXpTargetYpDurationpMode){
    if(
this.inMotion==undefinedthis.inMotion=false;
    
/* if in motion return because only one motion in time */
    
if(this.inMotion) return;
    
    
/* reset timebase */
    
this.0;
    
this.pDuration;
    
this.inMotion true;
    
    
/* calculate the offset/course */
    
var xOffset=pTargetX-this._x;
    var 
yOffset=pTargetY-this._y;
    
    
/* set start/begin position */
    
var sX this._x;
    var 
sY this._y;
    
    
this.onEnterFrame=function(){
        
this._x _global[pMode](this.tsXxOffsetthis.d);
        
this._y _global[pMode](this.tsYyOffsetthis.d);
        
        
/* if timebased the same as duration mc its new positon */
        
if(this.t==this.d){
            
delete this.onEnterFrame;
            
this.inMotion false;
            
trace("new xPos: "+this._x+"  // new yPos: "+this._y);
        }
        
this.t++;
    }

das ganze kannst du sehr einfach anwenden

PHP-Code:
/*
_level0._root.drop._x=200 == x = 200
_level0._root.drop._y=200  == y = 200
*/

var 200;
var 
200;
var 
frames 20// wie lange dauert deine animation

this.meinMc.slideTo(xyframes"easeOut"); 
__________________
TVNEXT Solutions
atothek ist offline   Mit Zitat antworten
Alt 29-07-2004, 11:51   #3 (permalink)
Neuer User
 
Registriert seit: Jul 2004
Beiträge: 20
Question Code Anwendung?

Hi danke für die schnelle Antwort, aber wie wende ich den Code an. Hab schon einiges ausprobiert will aber nicht klappen!
Danke für die Hilfe!!
MfG ju
finju 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 07:12 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele