| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| Neuer User 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 |
| | |
| | #2 (permalink) |
| Flashworker 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) |
| | |
| | #3 (permalink) |
| Neuer User 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; } |
| | |
| | #5 (permalink) |
| Neuer User 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... |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |