Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 03-06-2004, 19:24   #1 (permalink)
Neuer User
 
Benutzerbild von alexpetri
 
Registriert seit: Sep 2001
Ort: FrankfurtMain, Sondershausen
Beiträge: 710
page transition will nicht funzen....

Ich habe bei www.actionscript.org ein schönes Transitionscript
gefunden, was ich für mich ein wenig umformen wollte
sprich in der ursprünglichen Version lief das ganze
unendlich einfach so. (siehe setInterval)
jetzt habe ich das ganze versucht so umzubauen, das man auf
"buttonclick" (siehe unten) einen definierten mc "attacht"
nur funzt das ganze nur beim erstenmal, evtl kann mir ja jemand helfen wo der fehler ist. Datei ist dabei:


ActionScript:
  1. //Global vars
  2. mWidth = 350;
  3. //Create movie clip and mask
  4. counter = -1;
  5. createEmptyMovieClip('holder', 0);
  6. //createMovieClip();
  7. // animInt = setInterval(doAnim, 20);
  8. function createMovieClip(num) {
  9.     counter++;
  10. // statt 'pic' add num  stand  'pic' add (counter%2) da da es nur zwei mcs zum switchen gab 
  11. holder.attachMovie('pic' add num, 'pic' add counter, counter);
  12.     holder.createEmptyMovieClip('mask' add counter, counter+10000);
  13.     holder['pic' add counter].setMask(holder['mask' add counter]);
  14.     trace(('pic' add (counter%2)));
  15. }
  16. function doAnim() {
  17.     var currMC = holder['mask' add counter];
  18.     if (animIndex<15) {
  19.         // Schritt 1
  20.         //trace("animIndex<15");
  21.         var time = animIndex/15;
  22.         var dist = 0.5*Math.sin(Math.Pi*(time-0.5))+0.5;
  23.         with (currMC) {
  24.             clear();
  25.             beginFill(0x000000);
  26.             lineTo(mWidth, 0);
  27.             lineTo(mWidth, dist*125);
  28.             curveTo(250, dist*40, 0, 10*dist);
  29.             endFill();
  30.         }
  31.     } else if (animIndex<35) {
  32.         // schritt2
  33.         //trace("animIndex<35");
  34.         var time = (animIndex-15)/20;
  35.         var dist = 0.5*Math.sin(Math.Pi*(time-0.5))+0.5;
  36.         with (currMC) {
  37.             clear();
  38.             beginFill(0x000000);
  39.             lineTo(mWidth, 0);
  40.             lineTo(mWidth, 125);
  41.             curveTo(250-100*dist, 40+150*dist, 0, 10+190*dist);
  42.             endFill();
  43.         }
  44.     } else if (animIndex<=50) {
  45.         // schritt 3
  46.         //trace("animIndex<=50");
  47.         var time = (animIndex-35)/15;
  48.         var dist = 0.5*Math.sin(Math.Pi*(time-0.5))+0.5;
  49.         with (currMC) {
  50.             clear();
  51.             beginFill(0x000000);
  52.             lineTo(mWidth, 0);
  53.             lineTo(mWidth, 125+75*dist);
  54.             curveTo(150, 190+10*dist, 0, 200);
  55.             endFill();
  56.         }
  57.     }
  58.     animIndex++;
  59.     if (animIndex>50) {
  60.         trace("animIndex: "+animIndex);
  61.         animIndex = 0;
  62.         holder['pic' add (counter-1)].removeMovieClip();
  63.         holder['mask' add (counter-1)].removeMovieClip();
  64.         //createMovieClip();
  65.     }
  66. }
  67. //stop();
  68. //st.duplicateMovieClip('st0', 200000)
  69. a.onRelease = function() {
  70.     _root.createMovieClip(0);
  71.     this.i = 0;
  72.     this.onEnterFrame = function() {
  73.         if (i<51) {
  74.             _root.doAnim();
  75.             i++;
  76.         }
  77.     };
  78. };
  79. b.onRelease = function() {
  80.     _root.createMovieClip(1);
  81.     this.i = 0;
  82.     this.onEnterFrame = function() {
  83.         if (i<51) {
  84.             _root.doAnim();
  85.             i++;
  86.         }
  87.     };
  88. };
  89. c.onRelease = function() {
  90.     _root.createMovieClip(2);
  91.     this.i = 0;
  92.     this.onEnterFrame = function() {
  93.         if (i<51) {
  94.             _root.doAnim();
  95.             i++;
  96.         }
  97.     };
  98. };

übrigens kann man die Fkt irgendwie auslagern die bei onRelease aufgerufen wird?

saugen (als fla) kann man das ganze unter

http://www.tpz-online.de/my_swoosh1.rar
Angehängte Dateien
Dateityp: zip my_swoosh1.zip (2,3 KB, 8x aufgerufen)
__________________
Talk to the hand, cause the head aint listening
alexpetri 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 00:09 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele