Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 06-01-2006, 18:16   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2006
Beiträge: 10
probleme mit dem zusammenbauen

hallo
(ich arbeite mit flash mx 2004)
ich versuche gerade per AS meine animation zu steuern
die einzelnen bausteine von meinem code funktionieren auch aber wenn ich das zusammenbaue stimmt irgendwas nicht mehr

kann mir vielleicht von euch jemand helfen?

zweite frage: in meinem code erstelle ich über createEmptyMovieClip eine "kugel". kann ich auch einen schon vorhandenen MC nehmen?

mein AS-code:

createEmptyMovieClip("neutron_1", 10);
with(neutron_1) {
lineStyle (10, 0x707070);
lineTo (1, 0x000000);
_x = 0;
_y = 375;
}
var currentFrame = 0;
neutron_1.onEnterFrame = function() {
currentFrame++;
this._x = currentFrame*9;
if(currentFrame > 25) delete this.onEnterFrame;
}

//uran_1
_root.onEnterFrame = function() {
if(this.neutron_1.hitTest(uran_hilfe_1)) {
this.uran_1._alpha = 0;
this.uran_hilfe_1._alpha = 0;
this.neutron_1._alpha = 0;
}
//neutron_2
createEmptyMovieClip("neutron_2", 10);
with(neutron_2) {
lineStyle (10, 0x707070);
lineTo (1, 0);
_x = 225;
_y = 375;
}
var currentFrame = 25;
neutron_2.onEnterFrame = function() {
currentFrame++;
this._x = currentFrame*(-9);
if(currentFrame > 60) delete this.onEnterFrame;
this._y = currentFrame*6;
if(currentFrame > 60) delete this.onEnterFrame;
}
}

zur erklärung habe ich die .fla-datei mit drangehängt
Angehängte Dateien
Dateityp: rar steuerstab_4.rar (10,9 KB, 3x aufgerufen)
mutter_natur86 ist offline   Mit Zitat antworten
Alt 06-01-2006, 18:31   #2 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
aloha!

andere tiefe vergeben bei neutron_2;
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 06-01-2006, 18:36   #3 (permalink)
Neuer User
 
Registriert seit: Jan 2006
Beiträge: 10
danke
also müsste ich statt:
createEmptyMovieClip("neutron_2", 10);
einfach
createEmptyMovieClip("neutron_2", 11);
oder so schreiben?
mutter_natur86 ist offline   Mit Zitat antworten
Alt 06-01-2006, 18:38   #4 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
jo
jeder _level, jeder movieclip hat eigene tiefen;
hast du da einmal die tiefe 10 vergeben, dann dann ersetzt ein andres , dass auch tiefe 10 bekommt, das erste;
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary

Geändert von andretti (06-01-2006 um 18:40 Uhr)
andretti ist offline   Mit Zitat antworten
Alt 06-01-2006, 21:46   #5 (permalink)
Neuer User
 
Registriert seit: Jan 2006
Beiträge: 10
danke für die antwort. das mit der tiefe hab ich jetzt verstanden, was ich aber nicht verstehe ist warum dieser script nicht funktioniert:

Code:
createEmptyMovieClip("neutron_1", 10);
with(neutron_1) {
	lineStyle (10, 0x707070);
	lineTo (1, 0x000000);
	_x = 0;
	_y = 375;
}
var currentFrame = 0;
neutron_1.onEnterFrame = function() {
	currentFrame++;
	this._x = currentFrame*9;
	if(currentFrame > 25) delete this.onEnterFrame;
}

//uran_1
_root.onEnterFrame = function() {
	if(neutron_1.hitTest(uran_hilfe_1)) {
		this.neutron_1._alpha = 0;
		this.uran_1._alpha = 0;
		this.uran_hilfe_1._alpha = 0;
		
		//uran_2
		createEmptyMovieClip("neutron_2", 9);
		with(neutron_2) {
			lineStyle (10, 0x707070);
			lineTo (.5, 0);
			_x = 225;
			_y = 375;
		}
		var currentFrame = 25;
		neutron_2.onEnterFrame = function() {
			currentFrame++;
			this._x = currentFrame*9;
			if (currentFrame > 60) delete this.onEnterFrame;
		}
	}
}
mutter_natur86 ist offline   Mit Zitat antworten
Alt 06-01-2006, 21:54   #6 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
jo und wos funzt nit?
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 06-01-2006, 21:58   #7 (permalink)
Neuer User
 
Registriert seit: Jan 2006
Beiträge: 10
neutron_1 bewegt sich ideal
nachdem es auf uran_hilfe_1 getroffen hat verschwindet neutron_1, uran_1 und uran_hilfe_1 genauso wie ichs gewollt hab aber neutron_2 bleibt einfach stehen
mutter_natur86 ist offline   Mit Zitat antworten
Alt 06-01-2006, 22:09   #8 (permalink)
Neuer User
 
Registriert seit: Jan 2006
Beiträge: 10
aber wenn ich den zweiten teil einzeln ausprobier dann funktioniert des, also müsste des irgendwie an der kombination liegen
wenn ich das aber einzeln ausprobiere, fällt mir auf, dass die angegebenen koordinaten gar nicht stimmen. muss man die irgendwie anders angeben?

Code:
createEmptyMovieClip("neutron_2", 11);
with(neutron_2) {
	lineStyle (10, 0x707070);
	lineTo (.5, 0);
	_x = 100;
	_y = 450;
}
var currentFrame = 0;
neutron_2.onEnterFrame = function() {
	currentFrame++;
	this._x = currentFrame*11;
	this._y = currentFrame*(-10);
	if (currentFrame > 50) delete this.onEnterFrame;
}
(ich mein jetzt in diesem beispiel weil im anderen hats ja gestimmt
mutter_natur86 ist offline   Mit Zitat antworten
Alt 07-01-2006, 00:44   #9 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
PHP-Code:
createEmptyMovieClip("neutron_1"10);
with (neutron_1) {
    
lineStyle(100x707070);
    
lineTo(10x000000);
    
_x 0;
    
_y 375;
}
neutron_1.onEnterFrame = function() {
    
this._x += 10;
};
//uran_1
_root.onEnterFrame = function() {
    if (
this.neutron_1.hitTest(uran_hilfe_1)) {
        
this.uran_1._alpha 0;
        
this.uran_hilfe_1._alpha 0;
        
//this.neutron_1._alpha = 0;
        
delete this.onEnterFrame;
        
delete neutron_1.onEnterFrame;
        
removeMovieClip(_root.neutron_1);
        
//neutron_2    
        
_root.createEmptyMovieClip("neutron_2"11);
        
with (neutron_2) {
            
lineStyle(100x707070);
            
lineTo(10);
            
_x 225;
            
_y 375;
        }
        
neutron_2.onEnterFrame = function() {
            
this._x += 10;
        };
    }
}; 
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 07-01-2006, 09:42   #10 (permalink)
Neuer User
 
Registriert seit: Aug 2005
Beiträge: 136
danke danke danke
jetzt funktioniert es endlich
ich wär ohne deine hilfe nie weiter gekommen
mutter_natur ist offline   Mit Zitat antworten
Alt 07-01-2006, 11:18   #11 (permalink)
Neuer User
 
Registriert seit: Aug 2005
Beiträge: 136
schon wieder das gleiche problem:
es funktioniert aber wenn ich weiter schreib funktioniert es nicht mehr obwohl es einzeln schon funktioniert.
kann das sein dass der code manchmal stücke einfach rauslässt (weil es funktioniert aber wenn ich noch etwas dahinter schreibe geht das mittelstück nicht mehr)?
deswegen hab ich den code auf mehrere ebenen aufgeteilt (jeweils im ersten schlüsselbild)
würde mich freuen wenn sich das mal einer anschauen könnte
Angehängte Dateien
Dateityp: rar steuerstab_4.rar (10,4 KB, 0x aufgerufen)
mutter_natur 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 02:43 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele