Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 10-01-2008, 17:06   #1 (permalink)
Neuer User
 
Benutzerbild von dernils
 
Registriert seit: Jan 2006
Beiträge: 41
Script von flash 6 auf 8 , menüführung

Hallo zusammen,
ich habe ein Menü das nur bis flash 6 funktioniert. Stelle ich bei Einstellung für Veröffentlichen auf Flash 8, funktioniert das Script logischerweise nicht mehr.
Das Script sieht wie folgt aus:

var count=1; count<=items.length; count++) {
this["z" add count] = Math.cos((count*45) * (math.PI/180)) * 50;
this["y" add count] = Math.sin((count*45) * (math.PI/180)) * 50;
this["x" add count] = (count * 40) - (VerticeNum/2 * 40);
Vertex.duplicateMovieClip("Vertex" + count, count);
this["Vertex" + count].txt = items[count-1].txt;
this["Vertex" + count].action = items[count-1].action;
}
delete(items);

Line.duplicateMovieClip("Vertex10", 100);
setProperty("Vertex", _visible, 0);
setProperty("Line", _visible, 0);
CenterRotationX = 0;
CenterRotationY = 0;
TrailerX = 50;
TrailerY = 360;
// 3d calculation;
function calc3d() {
c = 0;
while (c < VerticeNum + 1) {
c++;
Xang = Xangle * (math.PI/180);
Yang = Yangle * (math.PI/180);
// -----------------------------------------
// --- y rotate ---
// -----------------------------------------
this["zpos" + c] = this["z" + c] * math.cos(Yang) - this["x" + c] * math.sin(Yang);
this["xpos" + c] = this["z" + c] * math.sin(Yang) + this["x" + c] * math.cos(Yang);
// -----------------------------------------
// --- x rotate ---
// -----------------------------------------
this["ypos" + c] = this["y" + c] * math.cos(Xang) - this["zpos" + c] * math.sin(Xang);
this["zpos" + c] = this["y" + c] * math.sin(Xang) + this["zpos" + c] * math.cos(Xang);
// -----------------------------------------
// -- 3d to 2d --
// -----------------------------------------
this["Depth" + c] = (1 / ((this["zpos" + c]/perspective) + 1));
// -----------------------------------------
// --- draw ---
// -----------------------------------------
this["Vertex" + c]._x = this["xpos" + c] * this["Depth" + c] + CenterRotationX;
this["Vertex" + c]._y = this["ypos" + c] * this["Depth" + c] + CenterRotationY;
this["Vertex" + c]._xscale = this["Vertex" + c]._yscale = (this["Depth" + c] / 2) * 500 ;
// -----------------------------------------
// --- Z-Sorting ---
// -----------------------------------------
this["Vertex" + c].swapDepths(this["Depth" + c] * 500);
}
}
// set angle;
function setAngle() {
TrailerY = TrailerY + (NewPosY - TrailerY)/5;
Xangle = TrailerY;
}

Ich bekomme folgende Fehlermeldung:

**Fehler** Symbol=Move3d, Ebene=Layer 1, Bild=1:Zeile 2: ']' erwartet
this["z" add count] = Math.cos((count*45) * (math.PI/180)) * 50;

**Fehler** Symbol=Move3d, Ebene=Layer 1, Bild=1:Zeile 3: ']' erwartet
this["y" add count] = Math.sin((count*45) * (math.PI/180)) * 50;

Anzahl der ActionScript-Fehler: 2 Gemeldete Fehler: 2

Keine Ahnung wie der Befehl Math.cos bzw Math.sin jetzt geschrieben wird.
Dürfte eigentlich nicht so schwer sein, aber ich hab schon einiges versucht und bekomme es nicht klar...Wär nett, wenn mir jemand helfen könnte.
Gruß
Nils
dernils ist offline   Mit Zitat antworten
Alt 10-01-2008, 17:20   #2 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
Hi

-Statt "add" ein "+" nehmen (seit Flash 5 veraltet)
-setProperty("Vertex", _visible, 0); => Vertex._visible = false; (seit Flash 5 veraltet)
-Auf Groß- und Kleinschreibung achten ("Math" statt "math" z.B.)

Und schön wäre es noch, wenn du alle Variablen deklarierst (->mit "var").

gruß

Geändert von sebastian (10-01-2008 um 17:21 Uhr)
sebastian ist offline   Mit Zitat antworten
Alt 10-01-2008, 17:46   #3 (permalink)
Neuer User
 
Benutzerbild von dernils
 
Registriert seit: Jan 2006
Beiträge: 41
Danke für deine schnelle Antwort. Hab add durch + ersetzt und auf Groß- bzw. Kleinschreibung geachtet. Das Menü funtioniert allerdings immer noch nicht.

Sieht jetzt so aus:

for (var count=1; count<=items.length; count++) {
this["z" + count] = math.cos((count*45) * (math.PI/180)) * 50;
this["y" + count] = math.sin((count*45) * (math.PI/180)) * 50;
this["x" + count] = (count * 40) - (VerticeNum/2 * 40);
Vertex.duplicateMovieClip("Vertex" + count, count);
this["Vertex" + count].txt = items[count-1].txt;
this["Vertex" + count].action = items[count-1].action;
}
delete(items);

Line.duplicateMovieClip("Vertex10", 100);
setProperty("Vertex", _visible, 0);
setProperty("Line", _visible, 0);
CenterRotationX = 0;
CenterRotationY = 0;
TrailerX = 50;
TrailerY = 360;
// 3d calculation;
function calc3d() {
c = 0;
while (c < VerticeNum + 1) {
c++;
Xang = Xangle * (math.PI/180);
Yang = Yangle * (math.PI/180);
// -----------------------------------------
// --- y rotate ---
// -----------------------------------------
this["zpos" + c] = this["z" + c] * math.cos(Yang) - this["x" + c] * math.sin(Yang);
this["xpos" + c] = this["z" + c] * math.sin(Yang) + this["x" + c] * math.cos(Yang);
// -----------------------------------------
// --- x rotate ---
// -----------------------------------------
this["ypos" + c] = this["y" + c] * math.cos(Xang) - this["zpos" + c] * math.sin(Xang);
this["zpos" + c] = this["y" + c] * math.sin(Xang) + this["zpos" + c] * math.cos(Xang);
// -----------------------------------------
// -- 3d to 2d --
// -----------------------------------------
this["Depth" + c] = (1 / ((this["zpos" + c]/perspective) + 1));
// -----------------------------------------
// --- draw ---
// -----------------------------------------
this["Vertex" + c]._x = this["xpos" + c] * this["Depth" + c] + CenterRotationX;
this["Vertex" + c]._y = this["ypos" + c] * this["Depth" + c] + CenterRotationY;
this["Vertex" + c]._xscale = this["Vertex" + c]._yscale = (this["Depth" + c] / 2) * 500 ;
// -----------------------------------------
// --- Z-Sorting ---
// -----------------------------------------
this["Vertex" + c].swapDepths(this["Depth" + c] * 500);
}
}
// set angle;
function setAngle() {
TrailerY = TrailerY + (NewPosY - TrailerY)/5;
Xangle = TrailerY;
}
dernils ist offline   Mit Zitat antworten
Alt 10-01-2008, 17:49   #4 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
Hast offensichtlich auch die Hälfte vergessen, "math" springt mir 20x ins Gesicht

(setProperty ist auch noch da)
sebastian ist offline   Mit Zitat antworten
Alt 10-01-2008, 18:03   #5 (permalink)
Neuer User
 
Benutzerbild von dernils
 
Registriert seit: Jan 2006
Beiträge: 41
sorry, ist irgendwie noch der Wurm drin. Muss ich noch irgendetwas ändern?

for (var count=1; count<=items.length; count++) {
this["z" + count] = Math.cos((count*45) * (Math.PI/180)) * 50;
this["y" + count] = Math.sin((count*45) * (Math.PI/180)) * 50;
this["x" + count] = (count * 40) - (VerticeNum/2 * 40);
Vertex.duplicateMovieClip("Vertex" + count, count);
this["Vertex" + count].txt = items[count-1].txt;
this["Vertex" + count].action = items[count-1].action;
}
delete(items);

Line.duplicateMovieClip("Vertex10", 100);
Vertex._visible = false;
Line._visible = false;
CenterRotationX = 0;
CenterRotationY = 0;
TrailerX = 50;
TrailerY = 360;
// 3d calculation;
function calc3d() {
c = 0;
while (c < VerticeNum + 1) {
c++;
Xang = Xangle * (Math.PI/180);
Yang = Yangle * (Math.PI/180);
// -----------------------------------------
// --- y rotate ---
// -----------------------------------------
this["zpos" + c] = this["z" + c] * Math.cos(Yang) - this["x" + c] * Math.sin(Yang);
this["xpos" + c] = this["z" + c] * Math.sin(Yang) + this["x" + c] * Math.cos(Yang);
// -----------------------------------------
// --- x rotate ---
// -----------------------------------------
this["ypos" + c] = this["y" + c] * Math.cos(Xang) - this["zpos" + c] * Math.sin(Xang);
this["zpos" + c] = this["y" + c] * Math.sin(Xang) + this["zpos" + c] * Math.cos(Xang);
// -----------------------------------------
// -- 3d to 2d --
// -----------------------------------------
this["Depth" + c] = (1 / ((this["zpos" + c]/perspective) + 1));
// -----------------------------------------
// --- draw ---
// -----------------------------------------
this["Vertex" + c]._x = this["xpos" + c] * this["Depth" + c] + CenterRotationX;
this["Vertex" + c]._y = this["ypos" + c] * this["Depth" + c] + CenterRotationY;
this["Vertex" + c]._xscale = this["Vertex" + c]._yscale = (this["Depth" + c] / 2) * 500 ;
// -----------------------------------------
// --- Z-Sorting ---
// -----------------------------------------
this["Vertex" + c].swapDepths(this["Depth" + c] * 500);
}
}
// set angle;
function setAngle() {
TrailerY = TrailerY + (NewPosY - TrailerY)/5;
Xangle = TrailerY;
}

Tut mir leid, wenn ich mich was dämlich anstelle...
dernils ist offline   Mit Zitat antworten
Alt 12-01-2008, 15:49   #6 (permalink)
Neuer User
 
Benutzerbild von dernils
 
Registriert seit: Jan 2006
Beiträge: 41
hm, sieht keiner, was ich da noch ändern muss?
dernils 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 05:24 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele