| |||||||
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) |
| Co&Bold Registriert seit: Nov 2004 Ort: Troisdorf (bei Köln)
Beiträge: 170
| Array oder if-Abfrage
Hallo, bin neu hier und hab auch schon direkt ein erstes Problem. Mein beispiel gibt es unter http://rrs.bd-2.de/privat_michael/index.swf zu sehen. Klickt man im zweiten Menüpunkt auf einen Submenüpunkt und scrollt nun wieder im Hauptmenue rum, so wird das Submenü nicht mehr richtig angezeigt, falls die maus keinen Punkt im Menü hovert. Hat jemand von euch vielleicht ne Ahnung, wie ich das am besten löse? Das helle hover-Feld im Hauptmenü heißt "Teil" und das im Submenü "Subteil" Hier der Code: Code: //ANNIMATION
////////////////////////////////////////////////
///////////// moveTeil
////////////////////////////////////////////////
function moveTeil() {
//Animation
//wenn ein button im hauptmenü geklickt, dann dorthin zurück, sonst zum button über dem die maus ist
if (_root.clicked != null && _root.overed == 0) {
_root.teil.tween("_x",_root.clicked,_root.speed, "easeOutCubic", 0);
_root.teil.tween("_width",_root.breite_c,_root.speed, "easeOutCubic", 0);
}
else {
_root.teil.tween("_x",_root.ziel,_global.speed, "easeOutCubic", 0);
_root.teil.tween("_width",_root.breite,_root.speed, "easeOutCubic", 0);
}
}
////////////////////////////////////////////////
///////////// moveSubTeil3
////////////////////////////////////////////////
function moveSubTeil3() {
//Animation
//wenn ein button im hauptmenü geklickt, dann dorthin zurück, sonst zum button über dem die maus ist
if (_root.subclicked != null && _root.subovered == 0) {
_root.sub3.subteil.tween("_x",_root.subclicked,_root.speed, "easeOutCubic", 0);
_root.sub3.subteil.tween("_width",_root.subbreite_c,_root.speed, "easeOutCubic", 0);
}
else {
_root.sub3.subteil.tween("_x",_root.subziel,_global.speed, "easeOutCubic", 0);
_root.sub3.subteil.tween("_width",_root.subbreite,_root.speed, "easeOutCubic", 0);
}
}
////////////////////////////////////////////////
///////////// moveSubTeil4
////////////////////////////////////////////////
function moveSubTeil4() {
//Animation
//wenn ein button im hauptmenü geklickt, dann dorthin zurück, sonst zum button über dem die maus ist
if (_root.subclicked != null && _root.subovered == 0) {
_root.sub4.subteil.tween("_x",_root.subclicked,_root.speed, "easeOutCubic", 0);
_root.sub4.subteil.tween("_width",_root.subbreite_c,_root.speed, "easeOutCubic", 0);
}
else {
_root.sub4.subteil.tween("_x",_root.subziel,_global.speed, "easeOutCubic", 0);
_root.sub4.subteil.tween("_width",_root.subbreite,_root.speed, "easeOutCubic", 0);
}
}
////////////////////////////////////////////////
///////////// moveSubTeil4
////////////////////////////////////////////////
function moveSubTeil5() {
//Animation
//wenn ein button im hauptmenü geklickt, dann dorthin zurück, sonst zum button über dem die maus ist
if (_root.subclicked != null && _root.subovered == 0) {
_root.sub5.subteil.tween("_x",_root.subclicked,_root.speed, "easeOutCubic", 0);
_root.sub5.subteil.tween("_width",_root.subbreite_c,_root.speed, "easeOutCubic", 0);
}
else {
_root.sub5.subteil.tween("_x",_root.subziel,_global.speed, "easeOutCubic", 0);
_root.sub5.subteil.tween("_width",_root.subbreite,_root.speed, "easeOutCubic", 0);
}
}
////////////////////////////////////////////////
///////////// moveSub
////////////////////////////////////////////////
function moveSub(y) {
if (y == 3) {
_root.sub3.tween("_x",_root.subpos3,_root.speed, "easeOutCubic", 0);
_root.sub3.tween("_alpha",_root.subalpha3,1, "easeOutCirc", 0);
}
if (y == 4) {
_root.sub4.tween("_x",_root.subpos4,_root.speed, "easeOutCubic", 0);
_root.sub4.tween("_alpha",_root.subalpha4,1, "easeOutCirc", 0);
}
if (y == 5) {
_root.sub5.tween("_x",_root.subpos5,_root.speed, "easeOutCubic", 0);
_root.sub5.tween("_alpha",_root.subalpha5,1, "easeOutCirc", 0);
}
}
////////////////////////////////////////////////
///////////// resetSub
////////////////////////////////////////////////
function resetSub(x) {
if (x != 3) {
_root.subpos3 = -500;
moveSub(3);
}
if (x != 4) {
_root.subpos4 = -500;
moveSub(4);
}
if (x != 5) {
_root.subpos5 = -500;
moveSub(5);
}
} Code: #include "lmc_tween.as"
_root.speed = 1;
//Schaltervariable und gleichzeitig wird die xpos vom button übergeben
_root.clicked = null;
_root.subclicked = null;
////////////////////////////////////////////////
///////////// menu button actions
////////////////////////////////////////////////
for (i=1; i<=8; i++) {
this["buttonname"] = "button" + i;
_root[this["buttonname"]].onRollOver = function () {
//wo soll das teil anhalten wenn over und anim fertig
_root.ziel = this._x;
_root.overed = 1;
_root.breite = this._width;
moveTeil();
//für untermenü
zahl = this._name.substring(6, 7);
//_root.subpos3 = this._x;
this["subpos"+zahl] = "subpos" + zahl;
_root[this["subpos"+zahl]] = this._x;
//_root.subalpha3 = 100;
this["subalpha"+zahl] = "subalpha" + zahl;
_root[this["subalpha"+zahl]] = this._x;
moveSub(zahl);
resetSub(zahl);
}
_root[this["buttonname"]].onRollOut = function () {
_root.overed = 0;
_root.breite = this._width;
moveTeil();
}
_root[this["buttonname"]].onRelease = function () {
_root.clicked = Math.floor(this._x);
_root.breite_c = this._width;
moveTeil();
///CONTENT TEST///
_root.conti = this._name + "clicked";
}
}//for
////////////////////////////////////////////////
///////////// Subnav3, die Erste :)
////////////////////////////////////////////////
for (i=1; i<=4; i++) {
this["buttonname"] = "button" + i;
//_root["liste"][this["container"+b]]
_root["sub3"][this["buttonname"]].onRollOver = function () {
//_root.sub3.button2.onRollOver = function () {
//_root[this["buttonname"]].onRollOver = function () {
_root.subziel = this._x;
_root.subovered = 1;
_root.subbreite = this._width;
moveSubTeil3();
}
_root["sub3"][this["buttonname"]].onRollOut = function () {
_root.subovered = 0;
_root.subbreite = this._width;
moveSubTeil3();
}
_root["sub3"][this["buttonname"]].onRelease = function () {
_root.subclicked = Math.floor(this._x);
_root.subbreite_c = this._width;
moveSubTeil3();
_root.conti = this._name + "clicked";
}
}//for
////////////////////////////////////////////////
///////////// Subnav4
////////////////////////////////////////////////
for (i=1; i<=3; i++) {
this["buttonname"] = "button" + i;
//_root["liste"][this["container"+b]]
_root["sub4"][this["buttonname"]].onRollOver = function () {
//_root.sub3.button2.onRollOver = function () {
//_root[this["buttonname"]].onRollOver = function () {
_root.subziel = this._x;
_root.subovered = 1;
_root.subbreite = this._width;
moveSubTeil4();
}
_root["sub4"][this["buttonname"]].onRollOut = function () {
_root.subovered = 0;
_root.subbreite = this._width;
moveSubTeil4();
}
_root["sub4"][this["buttonname"]].onRelease = function () {
_root.subclicked = Math.floor(this._x);
_root.subbreite_c = this._width;
moveSubTeil4();
_root.conti = this._name + "clicked";
}
}//for
////////////////////////////////////////////////
///////////// Subnav5
////////////////////////////////////////////////
for (i=1; i<=3; i++) {
this["buttonname"] = "button" + i;
//_root["liste"][this["container"+b]]
_root["sub5"][this["buttonname"]].onRollOver = function () {
//_root.sub3.button2.onRollOver = function () {
//_root[this["buttonname"]].onRollOver = function () {
_root.subziel = this._x;
_root.subovered = 1;
_root.subbreite = this._width;
moveSubTeil5();
}
_root["sub5"][this["buttonname"]].onRollOut = function () {
_root.subovered = 0;
_root.subbreite = this._width;
moveSubTeil5();
}
_root["sub5"][this["buttonname"]].onRelease = function () {
_root.subclicked = Math.floor(this._x);
_root.subbreite_c = this._width;
moveSubTeil5();
_root.conti = this._name + "clicked";
}
}//for ruft die Extension MovieClipTween 1_1_7 auf, die dafür benötigt wird...ihr wisst schon... |
| | |
| | #4 (permalink) | |
| Gast
Beiträge: n/a
| Zitat:
Und eine Kombination aus "_root" und "this" finde ich einfach grauenhaft, weil "this" bezieht sich sowieso auf die aktuelle Zeitleiste und ein _level0["buttonname"] wird als Objektpfad genauso reichen... | |
|
| | #7 (permalink) | |
| Co&Bold Registriert seit: Nov 2004 Ort: Troisdorf (bei Köln)
Beiträge: 170
| Zitat:
Also wenn ich das richtig verstehe, bezieht sich _level0 auf die hauptzeitleiste dieser swf-datei und _root auf die zeitleiste des übergeordneten films, wenn ich den hier in einen anderen reinlade. dann werd ich das sinnvollerweise mal ändern müssen. hab das menü jetzt abgeändert, dass es zwar nicht das tut, was ich gerne hätte, aber erstmal seine funktion erfüllt. mein nächstes problem ist ein preloader... zuerst soll ein intro laufen und wenn man dieses abbricht, soll man zu der hier beschriebenen seite kommen. allerdings sollen intro und hier die seite einen preloader bekommen, damit der user nicht denkt "hier kommt nichts mehr"... wie stelle ich das denn am geschicktesten an? | |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |