Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 12-03-2004, 03:44   #1 (permalink)
alter user
 
Benutzerbild von yaiyoo
 
Registriert seit: Feb 2003
Ort: Luzern
Beiträge: 1.248
Question Flash 5 = ja; Flash 6 = nein;

Hallo Jungs...

ist von Euch vielleicht jemand in der Lage, auf den ersten Blick zu erkennen, warum dieses Script zwar in Flash 5 läuft aber nicht in Flash 6???

Bin schon am verzweifeln...

ActionScript:
  1. accel = .8;
  2. convert = .6;
  3. Movieclip.prototype.sticky_load = function(menunumber) {
  4.     _parent.released = 0;
  5.     iterations = 5;
  6.     xstart = _x;
  7.     drag = 0;
  8.     ystart = _y;
  9.     targetx = xstart;
  10.     targety = ystart;
  11.     r = 2;
  12.     x = (2*Math.PI)*(number/iterations);
  13.     t = Math.tan(x);
  14.     mycol = new Color(internal);
  15.     _parent.drag = 0;
  16. };
  17. Movieclip.prototype.sticky_update = function() {
  18.     if (this.hitTest(_root._xmouse, _root._ymouse, true) and _parent.drag<2 and _parent.released == 0) {
  19.         if (random(5) == 0) {
  20.             counter++;
  21.             addcol = random(151);
  22.             mycol.setTransform({rb:addcol, gb:addcol, bb:addcol});
  23.         }
  24.         deltax = _parent._xmouse-xstart;
  25.         deltay = _parent._ymouse-ystart;
  26.         targetx = (_parent._xmouse-deltax/r);
  27.         targety = (_parent._ymouse-deltay/r);
  28.         if (drag == 0) {
  29.             this.swapDepths(2);
  30.             drag = 1;
  31.             _parent.drag++;
  32.         }
  33.     } else if (_parent.released == 0) {
  34.         mycol.setTransform({ra:100, ga:100, ba:100, rb:0, gb:0, bb:0});
  35.         targetx = xstart;
  36.         targety = ystart;
  37.         if (drag == 1) {
  38.             this.swapDepths(0);
  39.             drag = 0;
  40.             _parent.drag--;
  41.         }
  42.     } else {
  43.         targety = -170;
  44.         targetx = (t*85)-56;
  45.         if (_parent.trigger == 1) {
  46.             this.removeMovieClip();
  47.         }
  48.     }
  49.     xpos = xpos*_parent.accel+(targetx-this._x)*_parent.convert;
  50.     this._x += xpos;
  51.     ypos = ypos*_parent.accel+(targety-this._y)*_parent.convert;
  52.     this._y += ypos;
  53. };
  54. Movieclip.prototype.sticky_release = function(subname) {
  55.     if (_root.pause == 0) {
  56.         if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
  57.             _parent.atext = subname.toUpperCase();
  58.             _parent.released = 1;
  59.             _parent.label = subname;
  60.             _parent.atext = subname.toUpperCase();
  61.             _parent.gotoAndPlay(_parent._currentframe+1);
  62.         }
  63.     }
  64. };

Ist das eventuell ein Pfadproblem?

Wäre schön, wenn ihr ne Lösung wüßtet, möchte endlich wieder durchschlafen können.

mfg yaiyoo
yaiyoo ist offline   Mit Zitat antworten
Alt 12-03-2004, 07:41   #2 (permalink)
angry > always
 
Benutzerbild von ingohill
 
Registriert seit: Jul 2001
Ort: NRW
Beiträge: 1.635
flash 5 || 6

hi!

auf den ersten blick:
textfelder kann man in flash 5 keinen namen geben,
bzw sie damit ansprechen...
oder waren dies schaltflächen?

eins von beiden auf jeden fall!

gibt deine ausgabe nichts aus, wenn du
die einstellungen für veröffentlichen auf
flash 5 stellst?


ingo
__________________

on air: caliban | neaera | heaven shall burn | hatebreed | the agony scene
ingohill ist offline   Mit Zitat antworten
Alt 12-03-2004, 09:18   #3 (permalink)
Flashworker
 
Benutzerbild von sebastian
 
Registriert seit: Nov 2001
Ort: Wiesbaden
Beiträge: 10.945
ist sicherlich ein pfadproblem.

kleiner tipp: schreib alles nochmal neu..sieht nach nem oop versuch aus, der nicht so ganz geglückt ist..

lg sebastian
sebastian ist offline   Mit Zitat antworten
Alt 12-03-2004, 09:52   #4 (permalink)
r0b
Neuer User
 
Benutzerbild von r0b
 
Registriert seit: Feb 2002
Ort: Hamburg
Beiträge: 1.281
Die Nutzung von _parent macht irgendwie keinen Sinn. Die Methoden sollten auf den betreffenden mc angewendet werden und dann wäre "this" zu nutzen. Ebenso fliegen die ganzen genutzten Variablen später im _root rum, was sicherlich auch nicht die beste Lösung ist.
Also lieber:
ActionScript:
  1. this.xstart = this._x; // Um beim Start die Ausgangsposition zu speichern
  2.  
  3. var r = 2; // Wenn die Variable nur innerhalb der Methode gebraucht wird, oder:
  4. this.r = 2; // wenn man r später nochmal braucht.
  5.  
mfg

Robert
__________________
robertreich.de v4 | Pixelfonts & FlashSite Tutorial
Friends of ED - Byte Size Flash MX: Adventures in Optimization

"Give a man a fish, and he eats for a day... Show him how to fish, and he eats for a lifetime."
r0b ist offline   Mit Zitat antworten
Alt 12-03-2004, 21:26   #5 (permalink)
alter user
 
Benutzerbild von yaiyoo
 
Registriert seit: Feb 2003
Ort: Luzern
Beiträge: 1.248
Vielen Dank erstmal...

werd es gleich nochmal ausprobieren, obwohl ich das so ähnlich schon versucht hatte. *verzweifel*

Vielleicht hab ich ja diesmal Glück. Meld mich dann.

@ robert: Vielen Dank nochmal für die Mühe letztens.

mfg yaiyoo
yaiyoo 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 11:56 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele