Flash Zoom funktion

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Wie jetzt ?
    eigentlich kannst Du Dein MovieClip nehmen, der einen Instanznamen hat und folgendes schreiben.

    Beispiel :
    Du hast auf der Hauptbühne einen MC, der als Instanznamen MC hat.
    dann folgendes Script in einem Frame :

    Quellcode

    1. _level0.MC.onRollOver = function (){
    2. this._xscale = 150;
    3. this._yscale = 150;
    4. }
    5. _level0.MC.onRollOut = _level0.MC.onReleaseOutside = function (){
    6. this.MC._xscale = 100;
    7. this.MC._yscale = 100;
    8. }


    Oder, um das auf mehrere MovieClips zu übertragen folgendes :

    Quellcode

    1. MovieClip.prototype.zoom = function (){
    2. this.onRollOver = function (){
    3. this._xscale = 150;
    4. this._yscale = 150;
    5. }
    6. this.onRollOut = this.onReleaseOutside = function (){
    7. this.MC._xscale = 100;
    8. this.MC._yscale = 100;
    9. }
    10. }
    11. _level0.MC.zoom();
    12. _level0.MC2.zoom();
    Alles anzeigen

    etc.......
  • Fehlerteufel :

    script muss so aussehen :

    Quellcode

    1. MovieClip.prototype.zoom = function (){
    2. this.onRollOver = function (){
    3. this._xscale = 150;
    4. this._yscale = 150;
    5. }
    6. this.onRollOut = this.onReleaseOutside = function (){
    7. this._xscale = 100;
    8. this._yscale = 100;
    9. }
    10. }
    11. _level0.MC.zoom();
    12. _level0.MC2.zoom();
    Alles anzeigen
  • Hier mal der Code für AS, und mc is wieder der MovieClip...

    Quellcode

    1. MovieClip.prototype.zoomIt = function(y:Number,x:Number){
    2. this.yS = y;
    3. this.xS = x;
    4. this.onEnterFrame = function(){ //Eine OEF Funktion anlegen
    5. if(this._yscale > this.yS){
    6. this._yscale += (this.yS-this._yscale)/10;
    7. }
    8. if(this._yscale < this.yS){
    9. this._yscale += (this.yS-this._yscale)/10;
    10. }
    11. if(this._xscale > this.xS){
    12. this._xscale += (this.xS-this._xscale)/10;
    13. }
    14. if(this._xscale < this.xS){
    15. this._xscale += (this.xS-this._xscale)/10;
    16. }
    17. //Optional:
    18. if(this._yscale == this.yS && this._xscale == this.xS){
    19. delete this.onEnterFrame;
    20. }
    21. }
    22. }
    23. //Funktion anwenden:
    24. _root.mc.zoomIt(150,150);
    Alles anzeigen