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:0, y:0, z:500, dx:0, dy:0, dz:-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=0; n<this.wordList.length; n++) {
// pick a word from the list
var word = Object.environment.wordList[n];
var x = random(512)-256;
var y = random(384)-192;
var z = random(Object.environment.fl*2)-Object.environment.fl;
// create an instance of the SpaceWord object
nombre = "word"+String(depth++);
initialization = {txtword:word, x:x, y:y, z:z};
space.attachMovie("bubble_1", nombre, depth, initialization);
}
this.onEnterFrame = function() {
this.cam.dz += .5;
// move the camera to its destination
this.cam.x += (this.cam.dx-this.cam.x)/10;
this.cam.y += (this.cam.dy-this.cam.y)/10;
this.cam.z += (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.z += 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(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
};
// Connect the class with the linkage ID for this movie clip
Object.registerClass("bubble_1", bubble_1);
#endinitclip