Zurück   Flashforum > Flash > Flash Fortgeschritten > Flash 8

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 06-02-2008, 12:43   #1 (permalink)
Neuer User
 
Registriert seit: Aug 2005
Beiträge: 11
Post Actionscripts funktionieren nicht im Flash Player 8

Hallo miteinander,

folgende Scripts funktionieren mit Actionscipt 2 nur im Flash Player 6, ab 7 nicht mehr. Ursprünglich hab ich das Fla bei levitated unter Flash Player 6 und Actionscript 1 downgeloadet.

Vielleicht kommt jemand von euch auf Anhieb auf den Fehler (vermutlich liegt der bei der Schreibweise).


Vielen Dank im Voraus und Gruß,

Bixi

SCRIPT 1 auf root
PHP-Code:
// register root as environment
Object.environment this;
// create camera object
this.cam = {x:0y:0z:500dx:0dy:0dz:-500};
// set environmental constants
this.fl 2000;
// create 'space' to which all words will be attached
this.createEmptyMovieClip("space"1);
// center 'space' on the stage
space._x 512;
space._y 384;
// a string of words related to the wind
this.somewords "1 2 3 4";
// convert the string of words into an array of words
this.wordList = new Array();
this.wordList this.somewords.split(" ");
// create one instance for each word in the list
for (n=0n<this.wordList.lengthn++) {
    
// pick a word from the list
    
var word Object.environment.wordList[n];
    var 
random(512)-256;
    var 
random(384)-192;
    var 
random(Object.environment.fl*2)-Object.environment.fl;
    
// create an instance of the SpaceWord object
    
nombre "word"+String(depth++);
    
initialization = {txtword:wordx:xy:yz:z};
    
space.attachMovie("bubble_1"nombredepthinitialization);
}

this.onEnterFrame = function() {
    
this.cam.dz += .5;
    
// move the camera to its destination
    
this.cam.+= (this.cam.dx-this.cam.x)/10;
    
this.cam.+= (this.cam.dy-this.cam.y)/10;
    
this.cam.+= (this.cam.dz-this.cam.z)/30;
};
stop(); 


SCRIPT 2 im bubble_1 mc

PHP-Code:
#initclip

// constructor
function bubble_1() {
    
// set up button functionality
    
this.btnSquare.onRelease = function() {
        
// push the camera towards the word by setting destination just a bit in front
        
Object.environment.cam.dx this._parent.x;
        
Object.environment.cam.dy this._parent.y;
        
Object.environment.cam.dz this._parent.z+Object.environment.fl*.9;
        
// disable and hide button
        
this.enabled true;
        
this._visible true;
    };

    
// set continual function to render word
    
this.onEnterFrame this.render;
}
// allow SpaceWord to inherit MovieClip properties
bubble_1.prototype = new MovieClip();
// instance methods
bubble_1.prototype.render = function() {
    var 
zActual Object.environment.fl+this.z-Object.environment.cam.z;
    
// has the object moved behind the camera?
    
if (zActual>0) {
        
// object is still visible
        // calculate scale
        
var scale Object.environment.fl/zActual;
        
// set position using camera as an offset
        
this._x = (this.x-Object.environment.cam.x)*scale;
        
this._y = (this.y-Object.environment.cam.y)*scale;
        
// set size
        
this._xscale scale*50;
        
this._yscale scale*50;
        
// set fog
        
this._alpha 100 99 zActual/Object.environment.fl*.5;
    } else {
        
// object has moved behind camera
        // reposition further down the line
        
this.+= Object.environment.fl*2;
        
        
// enable button
        
this.btnSquare.enabled true;
        
this.btnSquare._visible true;
    }
};
bubble_1.prototype.setWord = function(s) {
    
this.txtWord s;
};
bubble_1.prototype.setPosition = function(xyz) {
    
this.x;
    
this.y;
    
this.z;
};

// Connect the class with the linkage ID for this movie clip
Object.registerClass("bubble_1"bubble_1);

#endinitclip 
Bixi ist offline   Mit Zitat antworten
Alt 07-02-2008, 02:29   #2 (permalink)
Techniker
 
Benutzerbild von hgseib
 
Registriert seit: Sep 2003
Ort: 64807
Beiträge: 16.324
AS2 kann kein prototype.
__________________
die ultimative antwort auf alle programmierfragen: der debugger
mfg h.g.seib www.SeibsProgrammLaden.de
hgseib ist offline   Mit Zitat antworten
Alt 07-02-2008, 11:22   #3 (permalink)
Neuer User
 
Registriert seit: Aug 2005
Beiträge: 11
Stimmt nicht.

Wir habens lösen können. Am Prototype hats nicht gelegen.
Aber danke für die Antwort trotzdem.
Bixi 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 20:21 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele