Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 17-06-2005, 11:05   #1 (permalink)
heide
 
Registriert seit: Nov 2001
Ort: wiesbaden
Beiträge: 114
endloses floating menu

hi,
ich programmiere zur zeit ein endloses bildband, welches einmal nach links, einmal nach rechts und on press das gewählte pic auf position 1 schiebt.

allerdings habe ich noch einige bugs, wie flackern und plötzliche löcherbildung.

hat da jemand ne idee, das ganze besser zu machen? ich komme irgendwie nicht weiter...

datei im anhang...

danke euch!


der code:

ActionScript:
  1. this.createEmptyMovieClip("pics", 1);
  2. for (i=1; i<50; i++) {
  3.     var mc = pics.attachMovie("pic", "pic"+i, i);
  4.     mc._x = 140*(i-1);
  5.     trace(mc._x);
  6.     mc.ident = i;
  7.     mc.onPress = function() {
  8.         smoveDirect(this.ident);
  9.     };
  10. }
  11. floatNum = i;
  12. pics.setMask("mask");
  13. mask._alpha = 0;
  14. //pics._xscale = pics._yscale = 10;
  15. btn1.onPress = function() {
  16.     smove(1);
  17. };
  18. btn2.onPress = function() {
  19.     smove(-1);
  20. };
  21. actPoint = floatNum;
  22. smove = function (val) {
  23.     dir = val;
  24.     smoveTimes = floatNum;
  25.     while (smoveTimes--) {
  26.         var ident = pics["pic"+smoveTimes];
  27.         ident.tween("_x", ident._x+(140*val), .5);
  28.     }
  29. };
  30. float = function () {
  31.     times = floatNum;
  32.     while (times--) {
  33.         if (pics["pic"+times]._x<=-300 && dir == -1) {
  34.            
  35.             pics["pic"+times]._x = pics["pic"+(floatNum-1)]._x+140*(pics["pic"+times].ident);
  36.         } else if (pics["pic"+times]._x>=mask._width+120 && dir == 1) {
  37.            
  38.             pics["pic"+times]._x = pics["pic"+(1)]._x+140*(pics["pic"+times].ident-floatNum);
  39.         }
  40.     }
  41.     updateAfterEvent();
  42. };
  43. smoveDirect = function (val) {
  44.     dir = -1;
  45.     smoveDirectTimes = floatNum;
  46.     pics["pic"+val].tween("_x", 0, 1);
  47.     actPoint = val;
  48.     if (actPoint == floatNum) {
  49.         actPoint = 1;
  50.     } else if (actPoint == 0) {
  51.         actPoint = floatNum-1;
  52.     }
  53.     while (smoveDirectTimes--) {
  54.         var ident = pics["pic"+smoveDirectTimes];
  55.         if (ident != pics["pic"+val]) {
  56.             ident.tween("_x", (ident.ident-actPoint)*140, 1);
  57.         }
  58.     }
  59. };
  60. myInterval = setInterval(float, 10);
Angehängte Dateien
Dateityp: zip floating.zip (25,9 KB, 16x aufgerufen)

Geändert von fusi (17-06-2005 um 11:11 Uhr)
fusi ist offline   Mit Zitat antworten
Alt 17-06-2005, 12:20   #2 (permalink)
Blockwart ;o)
 
Registriert seit: May 2005
Ort: Neu-Anspach (Hoch-Taunus)
Beiträge: 260
Sorry,aber warum machst Du Dir soviel Arbeit? Ist doch nix Anderes, wie ein abgewandeltes Yugop-Menue - und die gibt es fix-und fertig mittlerweile in Hunderten von Ausführungen zum freien Download.

Außerdem kannst Du nicht davon ausgehen, daß hier alle die movieclip-tweening-prototypes installiert haben, um Deinen Code zu checken...
__________________
------------
Gruß

Dat Bonsai

hups...Hier gibbet ja auch ne "Suchfunktion"... und---
hups..."F1" drücken kannte ich auch noch nicht ;)

Sternzeichen "Jungfrau" ... das dürfte vieles erklären ;)
DatBonsai 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 10:56 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele