Thema: Prototype
Beiträge zum Thema "Prototype"
| Prototype: Number.format [Flash 8]Tausender Punkte einfügen
Number.prototype.format = function(nr,pt) {
var str = "", s, v = this.toString();
while(s=v.substr(-nr)) {
v = v.substr(0,-nr);
str = (v.length!=0 ? pt : "")+s+str;
}
return str;
}
ASSetProp [...]
|
| Prototype: Movieclip.Prototyp._SHELL [Flash 8]Variablenwerte global schreiben und lesen
// Um aus JEDER Zeitleiste oder Objektaktion heraus eine globale Variable zu definieren, setze ich auf den Prototype _SHELL.
// Vorteil liegt darin, dass die Werte einer Variable ohne Pfadangaben erreichba [...]
|
| Prototype: Movieclip.Prototyp.MoveObject [Flash 8]Object-Positionswechsel bei Ereignis
// in einen frame der Hauptzeitleiste schreiben
MovieClip.prototype.moveobject = function() {
dest = _root.xnew;
pos = this._x;
vel = (dest-pos)/1.5;
this._x += vel;
};
// das auf den mc der sich [...]
|
| Prototype: Sound.mouseControl() [Flash 8]kontrolle von volume und pan über die mouse mit der begrennzun von einem mc
// Sound.mouseControl(target:MovieClip, maxVol:Number, cursor:Boolean)
Sound.prototype.mouseControl = function(target:MovieClip, maxVol:Number, cursor:Boolean) {
var sc [...]
|
| Prototype: fadeVolume() [Flash 8]hiermit kann man das Volumen faden
Sound.prototype.fadeIn = function($targetVol:Number, $steps:Number) {
var vol:Number = this.getVolume();
function interval($obj) {
vol += $steps;
$obj.setVolume(vol);
updateAfterEvent();
if (vol == [...]
|
| Prototype: getTotalTime [Flash 8]getTotalTime
Sound.prototype.getTotalTime = function():Number {
if (this.getBytesLoaded()<this.getBytesTotal()) {
return int(this.duration*this.getBytesTotal()/this.getBytesLoaded());
} else {
return this.duration;
}
};
// somit is [...]
|
| Prototype: patternFill [Flash 8]MC mit Hintergrundbild füllen und repeaten
//
// MovieClip.patternFill(tile:String, width:Number, height:Number):Void
//
// author: Tobias Friese
// date: 26.01.2006
//
///// requirements //
//
// » import flash.display.BitmapData;
// » [...]
|
| Prototype: createRectangleMC [Flash 8]schnell einen MC mit Rechteck erstellen
//
// MovieClip.createRectangleMC = function(instanceName:String, width:Number, height:Number, color:Color, alpha:Number, origin:String, depth:Number):MovieClip
//
// author: Tobias Friese
// date: 25.01. [...]
|
| Prototype: MovieClip.fitInto [Flash 8]MC auf Bereich skalieren
// MovieClip.fitInto(width:Number, height:Number):Void
//
// Author: Tobias Friese
// Date: 20.01.2006
//
MovieClip.prototype.fitInto = function(width:Number, height:Number):Void
{
var targetRatio = width / height [...]
|
| Prototype: Array.removeEmpty() [Flash 8]Enfernt leere Einträge aus einem Array
Array.prototype.removeEmpty = function() : Array
{
var cache_array:Array = new Array();
for (i=0; i<this.length;i++) if (this);
return cache_array;
};
var test:Array = new Array();
test = "Holga";
[...]
|
| Prototype: MovieClip.setzeMauszeiger [Flash 8]Benutzerdefinierter Mauszeiger
// Benutzerdefinierte Mauszeiger
MovieClip.prototype.setzeMauszeiger = function (unsichtbar)
{
if (unsichtbar)
{
Mouse.hide ();
}
this.onMouseMove = function ()
{
this._x = _xmouse;
this._y = _ymo [...]
|
| Prototype: MovieClip.setzeMausverfolger [Flash 8]Benutzerdefinierte Mausverfolger
// Benutzerdefinierte Mausverfolger
MovieClip.prototype.setzeMausverfolger = function (tempo)
{
this.onEnterFrame = function ()
{
this._x += (_xmouse - this._x) / tempo;
this._y += (_ymouse - this._y) / [...]
|
| Prototype: MovieClip.fpsmeter_extended [Flash 8]Bildrate (im Trace oder Textfeld)
MovieClip.prototype.fpsmeter_extended = function (aktion, ausgabe)
{
if (aktion == "start")
{
this.zaehler = 0;
this.onEnterFrame = function ()
{
this.zaehler++;
};
this.anzeigen = function [...]
|
| Prototype: changeParam [Flash 8]smoothe Parameterveränderung
MovieClip.prototype.changeParam = function(fps, step, param, aim, tol, mround) {
/* create unique object: */
this = new Object();
this.mc = this;
this.step = step;
this.param = param;
this.aim = aim;
this [...]
|
| Prototype: Object.prototype.ZoomIntDiv [Flash 8]Zoom-Effekt (Objekte MovieClip und Schaltflächen-Instanzen)
Object.prototype.ZoomIntervalDiv = function (pDim, pTempo, pBps)
{
var obj = this;
clearInterval(obj.iv);
obj.zoom = function ()
{
if (obj._xscale < pDim - 1 / pTempo)
{ [...]
|
| Prototype: MovieClip.prototype.ZoomIntDiv [Flash 8]Zoom-Effekt (IntDiv-Variante)
MovieClip.prototype.ZoomIntervalDiv = function (pDim, pTempo, pBps)
{
var obj = this;
clearInterval(obj.iv);
obj.zoom = function ()
{
if (obj._xscale < pDim - 1 / pTempo)
{
obj._xscale = obj._xs [...]
|
| Prototype: MovieClip.prototype.ZoomInt [Flash 8]Zoom-Effekt (Interval-Variante)
MovieClip.prototype.ZoomInterval = function (pOption, pDim, pTempo, pBps)
{
var obj = this;
clearInterval(obj.iv);
if (pOption)
{
obj.zoomIn = function ()
{
if (obj._xscale < pDim)
{
[...]
|
| Prototype: MovieClip.prototype.ZoomAdd [Flash 8]Zoom-Effekt (Add-Variante)
MovieClip.prototype.ZoomAdd = function (pOption, pDim, pTempo)
{
if (pOption)
{
this.onEnterFrame = function ()
{
if (this._xscale < pDim)
{
this._xscale = this._yscale += pTempo;
}
else
[...]
|
| Prototype: MovieClip.prototype.ZoomPulsar [Flash 8]Zoom-Effekt (Pulsar-Variante)
MovieClip.prototype.ZoomPulsar = function (pDim, pTempo)
{
this.onEnterFrame = function ()
{
if (this._xscale < pDim)
{
this._xscale = this._yscale += pTempo;
}
else if (this._xscale > pDim)
{
[...]
|
| Prototype: MovieClip.prototype.ZoomDiv [Flash 8]Zoom-Effekt (Div-Variante)
MovieClip.prototype.ZoomDiv = function (pDim, pTempo)
{
this.onEnterFrame = function ()
{
if (this._xscale < pDim - 1 / pTempo)
{
this._xscale = this._xscale + (pDim - this._xscale) / pTempo;
this._ysca [...]
|
| Prototype: Object._Depth [Flash 8]Tiefe von Objekten setzen und auslesen (MovieClip, Schaltflächen und Textfelder)
Object.prototype.addProperty ("_Depth", this.getTiefe = function ()
{
return this.getDepth ();
}, this.setTiefe = function (nr)
{
swapDepths.call (this, nr);
[...]
|
| Prototype: Number.prototype.runden_extend [Flash 8]Erweiterte Version (Runden/Round)
// --------------------------------------------------------------------
// Number.prototype.runden_extended
//
// Definition: zahl.runden(Rundungsmodus, DezimalZeichen, Genauigkeit)
//
// pModus - Rundungsmodu [...]
|
| Prototype: Runden (Klasse Extended) [Flash 8]Erweiterte Version
// Runden.as
// --------------------------------------------------------------------
// Klasse: Runden (Extended)
//
// Definition: Runden.runden_extended(pZahl, Rundungsmodus, DezimalZeichen, Genauigkeit)
//
// pZahl [...]
|
| Prototype: Runden (Klasse) [Flash 8]Runden Klasse - ActionScript 2.0
// --------------------------------------------------------------------
// Klasse: Runden (Runden.as)
//
// Definition: Runden.runden_extended(pZahl, Rundungsmodus, DezimalZeichen, Genauigkeit)
//
// pZahl [...]
| |
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News
Regeln & Bedingungen
|