Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 04-04-2006, 13:01   #1 (permalink)
Neuer User
 
Registriert seit: Feb 2004
Beiträge: 19
MC mit ActionScript bewegen

Hallo zusammen!
Ich möchte einen MC über Actionscript bewegen und habe folgendes probiert:

PHP-Code:
on (press) { 
    
_root.mc.onEnterFrame = function() {
        if (
this.speed>-5) {
            
this.speed-=.2;
        } 
        
this._x+=this.speed
    } 

Funktioniert auch super, aber nur, wenn ich den Film als Flash6 exportiere. Bei Export als Flash7 oder 8 funktioniert es zwar auch, aber erst ab dem zweiten Klick auf den Button!

Jemand eine Idee? Danke!
labr1005 ist offline   Mit Zitat antworten
Alt 04-04-2006, 13:11   #2 (permalink)
All-rounder
 
Benutzerbild von thebiz
 
Registriert seit: Mar 2004
Ort: Bayerische Rhön
Beiträge: 2.507
this.speed muss vorher schon festgelegt werden.

ActionScript:
  1. on (press) {
  2.     if (!this.speed) {
  3.         this.speed = 0;
  4.     }
  5.     this.onEnterFrame = function() {
  6.         if (this.speed > -5) {
  7.             this.speed -= .2;
  8.         }
  9.         this._x += this.speed;
  10.     };
  11. }
__________________

--------------------------------
Ich klicke, ergo bin ich. (me)
--------------------------------
thebiz ist offline   Mit Zitat antworten
Alt 04-04-2006, 13:15   #3 (permalink)
Neuer User
 
Registriert seit: Feb 2004
Beiträge: 19
Danke!

Alles klar und Danke!
labr1005 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:11 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele