Thursday, July 29th 2010, 1:34pm UTC+2
You are not logged in.
|
|
ActionScript-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
MovieClip.prototype.fade_position = function(xpos, ypos, faktor) {
this.onEnterFrame = function() {
this._x += (xpos-this._x)/faktor;
this._y += (ypos-this._y)/faktor;
trace(this._x);
if (Math.round(xpos-this._x) == 0 && Math.round(ypos-this._y) == 0) {
this._x = xpos;
this._y = ypos;
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.fade_scale = function (xscal,yscal,faktor) {
this.onEnterFrame = function () {
this._xscale += (xscal-this._xscale)/faktor
this._yscale += (yscal-this._yscale)/faktor
if (Math.round(xscal-this._xscale) == 0 && Math.round(yscal-this._yscale) == 0) {
this._xscale = xscal
this._yscale = yscal
delete this.onEnterFrame;
}
}
}
MovieClip.prototype.fade_alpha = function (wert,faktor) {
this.onEnterFrame = function () {
this._alpha += (wert-this._alpha)/faktor
if (Math.round(wert-this._alpha) == 0) {
this._alpha = wert
delete this.onEnterFrame;
}
}
}
|
|
|
ActionScript-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
MovieClip.prototype.base = function(name2, x, y, w, h, ebene) {
this.createEmptyMovieClip(name2, ebene);
with (this[name2]) {
beginFill(006633, 0);
lineStyle(0, 111111, 100);
moveTo(x, y);
lineTo(x+w, y);
lineTo(x+w, y+h);
lineTo(x, y+h);
lineTo(x, y);
endFill();
}
};
this.base("menu_leiste", 50, 0, 60, 570, 1);
this.base("navi_leiste", 0, 150, 10, 30, 2);
this.base("ct_frame", 200, 200, 500, 350, 3);
MovieClip.prototype.fade_scale = function (xscal,yscal,faktor) {
this.onEnterFrame = function () {
this._xscale += (xscal-this._xscale)/faktor
this._yscale += (yscal-this._yscale)/faktor
if (Math.round(xscal-this._xscale) == 0) {
this._xscale = xscal
this._yscale = yscal
delete this.onEnterFrame;
}
}
}
_root.bt1.onRelease=function(){
_root.navi_leiste.fade_scale(400,400,8)
}
|
|
|
ActionScript-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 |
//vorm skalieren
w = this._width;
h = this._heigth;
//nach dem skalieren
f= (this._xscale)/100 ; // z.bsp. 400% dividiert durch 100 = 4
nx = 0 - (f/2);
ny = 0 - (f/2);
this._x = nx;
this._y = ny;
|


|
|
ActionScript-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
MovieClip.prototype.fade_position = function (xpos,ypos,faktor) {
this.onEnterFrame = function () {
this._x += (xpos-this._x)/faktor
this._y += (ypos-this._y)/faktor
if (Math.round(xpos-this._x) == 0) {
this._x = xpos
this._y = ypos
delete this.onEnterFrame;
}
}
}
MovieClip.prototype.fade_alpha = function (wert,faktor) {
this.onEnterFrame = function () {
this._alpha += (wert-this._alpha)/faktor
if (Math.round(wert-this._alpha) == 0) {
this._alpha = wert
delete this.onEnterFrame;
}
}
}
content_mc.onRelease = function(){
display_mc.fade_position(600,0,6)
}
content_mc.onRelease = function(){
display_mc.fade_alpha(100,6)
}
|
This post has been edited 1 times, last edit by "Vmax" (Oct 7th 2006, 3:29pm)
|
|
ActionScript-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
MovieClip.prototype.fade_position = function(xpos, ypos, faktor, obj) {
this.createEmptyMovieClip('move_object', 1234);
var mc = this['move_object'];
mc.onEnterFrame = function() {
obj._x += (xpos-obj._x)/faktor;
obj._y += (ypos-obj._y)/faktor;
if (Math.round(xpos-obj._x) == 0) {
obj._x = xpos;
obj._y = ypos;
delete mc.onEnterFrame;
}
};
};
MovieClip.prototype.fade_alpha = function(wert, faktor, obj) {
this.createEmptyMovieClip('alpha_object', 12345);
var mc = this['alpha_object'];
mc.onEnterFrame = function() {
obj._alpha += (wert-obj._alpha)/faktor;
if (Math.round(wert-obj._alpha) == 0) {
obj._alpha = wert;
delete mc.onEnterFrame;
}
};
};
content_mc.onRelease = function() {
fade_position(600, 0, 6, display_mc);
fade_alpha(100, 6, display_mc);
};
|
Quoted
also nicht das man die 2 ebenen fest angibt wie es oben gemacht wurde das würde ich vermeiden...
Quoted
**Fehler** C:\Dokumente und Einstellungen\Peter\Desktop\fade position\fade_position.as: Zeile 11: Klassenskripts in ActionScript 2.0 können nur Klassen- oder Schnittstellenkonstrukte definieren.