Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 06-06-2005, 16:37   #1 (permalink)
Neuer User
 
Benutzerbild von sethmorrison
 
Registriert seit: May 2005
Beiträge: 88
Arrow scroller bleibt nicht stehen...?!!

hallo!

hab hier ein scroller-script gestohlen ... es ein wenig umgebaut aber jetzt funzt
der stop bei einer bestimmten _x position nicht mehr.
evtl. weiss jemand wo der hund begraben liegt?

hier das script:
ActionScript:
  1. function move(mc, pos) {
  2.     mc.onEnterFrame = function() {
  3.         if (pos == 1) {
  4.             this._x += 5;
  5.         }
  6.         if (pos == 2) {
  7.             this._x += 10;
  8.         }
  9.         if (pos == 3) {
  10.             pos = 1;
  11.         }
  12.                 // also hier bleibt er nicht stehen
  13.         if (this._x == 0) {
  14.             pos = 0;
  15.         }
  16.         if (pos == 4) {
  17.             this._x -= 5;
  18.         }
  19.         if (pos == 5) {
  20.             this._x -= 10;
  21.         }
  22.         if (pos == 6) {
  23.             pos = 4;
  24.         }
  25.                 // und hier auch nicht
  26.         if (this._x == -590) {
  27.             pos = 0;
  28.         }
  29.         if (pos == 0) {
  30.             delete this.onEnterFrame;
  31.         }
  32.     };
  33. }
  34. rechts.onRollOver = function() {
  35.     move(mc1, 1);
  36. };
  37. rechts.onPress = function() {
  38.     move(mc1, 2);
  39. };
  40. rechts.onRelease = function() {
  41.     move(mc1, 3);
  42. };
  43. rechts.onRollOut = function() {
  44.     move(mc1, 0);
  45. };
  46. links.onRollOver = function() {
  47.     move(mc1, 4);
  48. };
  49. links.onPress = function() {
  50.     move(mc1, 5);
  51. };
  52. links.onRelease = function() {
  53.     move(mc1, 6);
  54. };
  55. links.onRollOut = function() {
  56.     move(mc1, 0);
  57. };



die .fla hängt auch noch dran....


cheers
greetz!
Angehängte Dateien
Dateityp: zip test1.zip (32,7 KB, 4x aufgerufen)
sethmorrison ist offline   Mit Zitat antworten
Alt 06-06-2005, 18:45   #2 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
aloha;

erstens:
"move" ist ein wort aus der flash-syntax, also nix gut, wenn due dieses wort verwendest;
zweitens:

dass das script dennoch nicht richtig funktioniert, weißt du?
die bremse durch die if anweisung wirkt nur bedingt;
bei neuerlichem rollOver oder Release oder Press wandert das bild weiter;

ActionScript:
  1. function moving(mc, pos) {
  2.     mc.onEnterFrame = function() {
  3.         if (pos == 1) {
  4.             this._x += 5;
  5.         }
  6.         if (pos == 2) {
  7.             this._x += 10;
  8.         }
  9.         if (pos == 3) {
  10.             pos = 1;
  11.         }
  12.         if (this._x == 0) {
  13.             pos = 0;
  14.         }
  15.         if (pos == 4) {
  16.             this._x -= 5;
  17.         }
  18.         if (pos == 5) {
  19.             this._x -= 10;
  20.         }
  21.         if (pos == 6) {
  22.             pos = 4;
  23.         }
  24.         if (mc._x<=-650) {
  25.             pos = 0;
  26.         }
  27.         if (pos == 0) {
  28.             delete this.onEnterFrame;
  29.         }
  30.     };
  31. }
  32. rechts.onRollOver = function() {
  33.     moving(mc1, 1);
  34. };
  35. rechts.onPress = function() {
  36.     moving(mc1, 2);
  37. };
  38. rechts.onRelease = function() {
  39.     moving(mc1, 3);
  40. };
  41. rechts.onRollOut = function() {
  42.     moving(mc1, 0);
  43. };
  44. links.onRollOver = function() {
  45.     moving(mc1, 4);
  46. };
  47. links.onPress = function() {
  48.     moving(mc1, 5);
  49. };
  50. links.onRelease = function() {
  51.     moving(mc1, 6);
  52. };
  53. links.onRollOut = function() {
  54.     moving(mc1, 0);
  55. };
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 06-06-2005, 18:45   #3 (permalink)
---
 
Benutzerbild von kakktus
 
Registriert seit: Apr 2002
Beiträge: 2.054
HI,
Bei mir wird das on EnterFrame deletet.
Oder ws genau soll passieren??
__________________

Gruß kakktus
kakktus ist offline   Mit Zitat antworten
Alt 06-06-2005, 19:00   #4 (permalink)
Neuer User
 
Benutzerbild von sethmorrison
 
Registriert seit: May 2005
Beiträge: 88
nicht über ränder hinaus

...der mc1 film sollte nicht über die angegebenen ränder hinausfahren,
dass onRollOut funktioniert auch...

das problem liegt meines erachtens hier:
ActionScript:
  1. if (this._x == 0) {
  2.             pos = 0;
  3.         }

irgendwie bleibt er bei der _X position 0 nicht stehen?!


danke für deine hilfe!




greetz!

Geändert von sethmorrison (06-06-2005 um 19:30 Uhr)
sethmorrison 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 06:19 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele