Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 15-07-2004, 08:45   #1 (permalink)
ulrichbien
Gast
 
Beiträge: n/a
Prototyp will nicht...

Hallo zusammen,

dieses Skript weigert sich einfach. Flash zeichnet nicht einmal das Rechteck auf die Bühne - ganz zu schweigen von der onRelease-Funktion:

Code:
MovieClip.hintergrund.prototype = function (name2, x, y, w, h, ebene) {
	this.createEmptyMovieClip(name2, ebene);
	with (name2) {
		beginFill(000000, 100);
		lineStyle(0, 000000, 100);
		moveTo(x, y);
		lineTo(x+w, y);
		lineTo(x+w, y+h);
		lineTo(x, y+h);
		lineTo(x, y);
		endFill();
};
	}
}
hintergrund("test", 10, 500, 100, 100, 500);
test.onRelease =function () {trace("Hallo");}
Was ist falsch?


Danke und Grüße,

Ulrich
  Mit Zitat antworten
Alt 15-07-2004, 09:11   #2 (permalink)
Neuer User
 
Benutzerbild von mimaba
 
Registriert seit: May 2003
Beiträge: 81
syntax fehler, so funktionierts:

PHP-Code:
MovieClip.prototype.hintergrund = function(name2xywhebene) {
    
this.createEmptyMovieClip(name2ebene);
    
with (this[name2]) {
        
beginFill(000000100);
        
lineStyle(0000000100);
        
moveTo(xy);
        
lineTo(x+wy);
        
lineTo(x+wy+h);
        
lineTo(xy+h);
        
lineTo(xy);
        
endFill();
    }
};
this.hintergrund("test"10500100100500);
this.test.onRelease = function() {
    
trace("Hallo");
}; 
mimaba ist offline   Mit Zitat antworten
Alt 15-07-2004, 09:13   #3 (permalink)
experience++;
 
Benutzerbild von salazar
 
Registriert seit: Jul 2002
Ort: Düsseldorf
Beiträge: 11.347
die syntax für den prototyp ist etrwas flasch! dazu reicht hier auch ne normale function!

PHP-Code:
function hintergrund(name2xywhebene) {
    
this.createEmptyMovieClip(name2ebene);
    
with (name2) {
        
beginFill(000000100);
        
lineStyle(0000000100);
        
moveTo(xy);
        
lineTo(x+wy);
        
lineTo(x+wy+h);
        
lineTo(xy+h);
        
lineTo(xy);
        
endFill();
    };
}
hintergrund("test"10500100100500);
test.onRelease = function () {trace("Hallo");} 
also jetzt macht er wenigstens was.. obs richtig ist weiß ich nicht.
cya, sal
__________________
Bitte keine Flashfragen an mich schicken. Dafür ist ja das Forum da! Das betrifft auch Profilnachrichten.
Chuck Norris hat den Flash Player für alle mobilen Betriebssysteme!
salazar ist offline   Mit Zitat antworten
Alt 15-07-2004, 09:16   #4 (permalink)
ulrichbien
Gast
 
Beiträge: n/a
Geht! Immer diese Klammern... DANKE

und Grüße!
  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 03:02 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele