Flash Tipps > Flash CS2 - Tutorials und Tipps
Flash CS2 - Tutorials und Tipps
Adobe Flash/Flex Tutorials, Tipps und Code Snippets
| Adressleiste (URL) auslesen04.02.2010 - 11 Kommentare - italia Hallo zusammen,
vielleicht ist es für die Profis unter uns lachhaft, aber für uns Andere ganz interessant.
Wie kann ich die Adressleiste meines Browsers aus Flash auslesen?
So:
import flash.external.*;
var hostname = "window.location.hos [...]
|
| Tooltip Klasse mit DropShadow01.10.2009 - 13 Kommentare - Vampire Hallo zusammen,
ich habe eine kleine Tooltip-Klasse geschrieben, die ich euch gern zur Verfügung stellen möchte.
- Katalogisieren von Tooltips
- Anzeige von nicht-katalogisierten Tooltips
- Verzögertes oder sofortiges Anzeigen der Toolti [...]
|
| Prototype: preMenuConstructionKit07.04.2009 - 0 Kommentare - Visie Recursive Menu Constructor
MovieClip.prototype.___preMenu = function (xml:Object, targetnode:String) {
trace(this)
var infinity:Number = 0;
var targetnode:Object = (targetnode == null || targetnode == undefined) ? "subnavigation" : targetnode [...]
|
| Prototype: Array.findnumberPrototype, um die Indexzahl eines Wertes zu erhalten
Array.prototype.findnumber = function(eingabe) {
for (i=0; i<=this.length; i++) {
trace(this);
if (eingabe == this) {
return i;
}
}
};
;
trace(Beispiel.findnumber("Wert4"));
[...]
|
| Prototype: MovieClip.prototype.smoothContglättet den Inhalt eines MovieClips
/**
* glättet den Inhalt eines MovieClips (bei Bildern sinnvoll).
* Funktioniert anscheinend aber nicht, wenn das Bild nicht auf der selben Domain ist ...
*/
MovieClip.prototype.smoothContent = function (): [...]
|
| [HOT] Datenaustausch via JSON06.03.2008 - 16 Kommentare - burnZ
Schuld ist eigentlich das ich dazu komme dieses ersmal kleine...hmm ja
Tutorial zu schreiben. Eigentlich sollte etwas größeres entstehen was dann
ein richtig Tutorial für das großes werden sollte, aber eigentlich halte ich es für angebrach [...]
|
| Prototype: Array.prototype.groupgruppiert und zählt die Elemente eines Arrays
/**
* diese Methode gruppiert alle Elemente eines Arrays zählt diese dann gruppenweise durch
* und gibt ein Array zurück, welches an jeder Stelle ein Ursprungselement und seine Häufigkeit enthält [...]
|
| Flash 8 Dokumentation (Download)04.09.2007 - 2 Kommentare - Madokan So nun ist die Dokumentation zu Flash 8 endlich auch separat erhältlich. Bisher jedoch lediglich in Englisch!
Downloads:
http://www.macromedia.com/support/documentation/en/flash/
Ihr könnt zwischen PDF und HTML wählen und auch entscheiden [...]
|
| [Flash/PHP] newsletterin dem heutigen kleinen Tut geht es darum, wie man mit flash und php ein newsletterprogram machen kann ...
die Frage kam hier auf:
http://flashhilfe.de/forum/off-topic/newsletter-software-ot-194986-194986.html
es wäre etwas geschickter und vor [...]
|
| Dateigröße verkleinern bei nachgeladenen SWFs14.06.2007 - 0 Kommentare - valuee Wenn SWF-Dateien nachgeladen werden und diese Dateien Klassen verwenden, die bereits im Root-SWF importiert wurden, dann sind diese Klassen ja mehrmals kompiliert. Das ist nicht nötig, da der Root-Film die Klassen ja bereits kennt.
Möchte man d [...]
|
| Prototype: Foreach13.06.2007 - 0 Kommentare - burnZ Auf jedes Item ein Callback Anwenden
Array.prototype.foreach = function( callback:Function )
{
for( var index:String in this ) callback( index, this );
}
;
function traceIt( index:String, item:Object ):Void
{
trace( item.name + '/' [...]
|
| Prototype: Movieclip.Prototyp.ll_quadviereck in neuen MC zeichnen (pfad ungebunden)
MovieClip.prototype.ll_quad = function (_tt:String, _d:Number, _nmc:String, __xtl:Number, __ytl:Number, __xtr:Number, __ytr:Number, __xbr:Number, __ybr:Number, __xbl:Number, __ybl:Number, __v:Boolean, [...]
|
| Die ZigoEngine von MosesHi Leutz,
muss jetzt einfach mal n bissel Werbung für die ZigoEngine machen. ^^
Für Alle die sie noch nich kennen:
Da es manchmal ziemlich schwierig ist mit der Tween-Klasse von Flash um zu gehen bzw. auch Zeit und Tipparbeit kostet eine kom [...]
|
| There is no method with the name ...18.05.2007 - 0 Kommentare - Lenzoi Hier eine kleine Feststellung, die mich jetzt einiges an Zeit gekostet hat, was ich anderen Leuten ersparen will:
Beispiel:
import calendar.*;
class DayView{
private var calendar:Calendar;
public function DayView(){
cal [...]
|
| Prototype: .prototype.attachedMoviesfügt neue eigenschaft hinzu, in der attachte mcs sind
//definiere eine Funktion, die uns später nen String mit allen attachten Movies gibt
var toString:Function = function ():String {
var a:Array = new Array();
for (var s:String in this) {
[...]
|
| Prototype: MovieClip.prototype.Rectangle_29.04.2007 - 0 Kommentare - wolf81 einfaches dynamische Rechteck
//Schnelles Rechteck dynamisch erstellen
// author: Wolf81
// date: 29_04_2007
//
//sehr einfaches und schnelles Rechteck z.b. für dynamische Hintergrundflächen
//keine Auswahl von Erstellungsrichtung
//kein [...]
|
| Prototype: Movieclip.Prototyp.ll_fillsBitmap-Füllung aus Bibliothek auf mc anwenden (einfach)
MovieClip.prototype.ll_fills = function(BitmapDataItem) {
this._bdi = BitmapDataItem;
var tile:BitmapData = BitmapData.loadBitmap(this._bdi);
this.beginBitmapFill(tile);
this.moveTo(0 [...]
|
| Prototype: Movieclip.Prototyp.ll_fillBitmap-Füllung aus Bibliothek auf mc anwenden
MovieClip.prototype.ll_fill = function(GlobalMarginLeft, GlobalMarginTop, GlobalMarginRight, GlobalMarginBottom, BitmapDataItem, BitmapDataAlpha, debug) {
this._gml = GlobalMarginLeft;
this._gmt = [...]
|
| Prototype: Movieclip.Prototyp.ll_posPositions- und Eiganschaftswerte "fließend" ändern
MovieClip.prototype.ll_pos = function(newHeight, newWidth, newX, newY, newSP, newSPD, newSPK, newAlpha, round, callback, debug) {
this._dx = newX;
this._dy = newY;
this._dh = newHeight;
t [...]
|
| Prototype: String.prototype.chunkSplitTeilt einen String in Teilstücke gleicher Länge
/**
* Ähnlich str_split in PHP. Teilt einen String in höchstens limit Teile der chunkLength und gibt das Ergebnis als Array zurück
*/
String.prototype.chunkSplit = function (chunkLength:Number [...]
|
| Prototype: String.prototype.padString auffüllen
/**
* Diese Methode füllt den String bis zu einer gewissen Größe auf, mit übergebenen Argument padString.
* Es kann von links, von rechts und beidseitig gepaddet werden.
* Das Verhalten ist dem von PHP's str_pad gleich ...
[...]
|
| Prototype: intrinsic classDas finden und anpassen intrinsischer Klassen
/*Das hier ist kein prototype, allerdings recht wichtig im Zusammenhang mit der richtigen Verwendung.
Flash unterstützt dass Konzept "intrinsischer" Klassen, die man lediglich deklariert, deren Imp [...]
|
| Prototype: Array.prototype.walkFührt eine Funktion für jeden Index eines Arrays aus
= function (todo:Function) {
for (var i:Number = 0;i<this.length;i++) {
todo.apply(this,);
}
}
//rechne Partialsummen einer Folge aus ... :D
var f:Function = function (index:Number) [...]
|
| Prototype: Array.prototype.fillfüllt ein Array
/* gibt ein Array zurück, welches mit dem Ursprungsarray beginnt und auf die neue Länge mit einem bestimmten wert aufgefüllt wird. Ist die neue Länge kürzer als die Ursprungslänge, wird das Array einfach gekürzt.
das urspr [...]
|
| Prototype: Object.prototype.idgibt automatisch bei Bedarf jedem Objekt in Flash eine einzi
/*
* dies erlaubt, dass man von jeder Variable eine id abrufen kann ...
* diese wird erst erstellt, wenn man das erste Mal auf sie zugreift
*/
var idCounter:Number = -1;
var g:Functi [...]
|
| Prototype: Number.prototype.toStringeinen Bug aus der Standardroutine beheben
/**
* Dieser Prototype soll ein Flashinternes Problem lösen, dass beim
* konvertieren von ganzzahligen Numbers in Strings bei anderen Basen als 10 (beispielsweise hex) auftaucht
* ist die Basis nicht 10 [...]
|
| Prototype: rotateTo16.03.2007 - 0 Kommentare - mathis Drehung mit Angabe des Zielwinkels, der Drehrichtung und der easing-Funktion
// === dir ===
// short: den kurzen weg
// long: den langen weg
// ccw: gegen den uhrzeigersinn
// cw: mit dem uhrzeigersinn
MovieClip.prototype.rotateTo = function(e [...]
|
| MTASC - Debuggen mit Firebug (mtasc2firebug)Manfred Weber hat in seinem Blog http://manfred.dschini.org ein Interessantes Tool zum Flash debuggen gepostet.
http://manfred.dschini.org/2007/03/14/make-mtasc-talk-to-firebug/
http://manfred.dschini.org/2007/03/15/mtasc-2-firebug-improved/
Wer [...]
|
| Prototype: smoothToMouse21.02.2007 - 0 Kommentare - mathis Mausverfolgung mit Angabe der maximalen Geschwindigkeit und Abbremsen am Ende
MovieClip.prototype.smoothToMouse = function(maxSpeed, brakeDist) {
this.onEnterFrame = function() {
var difX:Number = this._parent._xmouse - this._x;
[...]
|
| Prototype: Movieclip.Prototyp.PauseMC auf seiner Zeitleite pausieren lassen
MovieClip.prototype.kaffeepause= function(dur) {
this.stop();
this.clearduration= function() {
clearInterval(this.newduration);
delete this.newduration;
delete this.clear [...]
|
| PHP SOAP Webservices mit Flash!Hier ein kleines Tutorial zur Benutzung des Pear Packetes Services_Webservice mit Flash.
Services_Webservice ist ein Packet mit dem man komfortabel Webservices und WSDL erstellt. Die Idee dazu kam mir als ich eine eine Weile mit C# experimentiert [...]
|
| Prototype: Movieclip.Prototyp.typeWriterTypewriter-Effekt
TextField.prototype.typeWriter = function(tw_str, tw_speed, tw_random) {
var tw_tf:TextField = this;
var tw_i:Number = 0;
var tw_txt:String = tw_str;
var tw_int:Number;
var tw_last:Function;
var tw_random:Number;
var [...]
|
| Prototype: Movieclip.Prototyp.FadeOutMC ausblenden (_alpha)
MovieClip.prototype.fadeOut = function(speed) {
this.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=0) {
delete this.onEnterFrame;
this._visible = false;
}
};
};
mein_mc.fadeOut(3); [...]
|
| Prototype: Movieclip.Prototyp.FadeInMC einblenden (_alpha)
MovieClip.prototype.fadeIn = function(speed) {
this.onEnterFrame = function() {
this._alpha += speed;
ac._visible = true;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
};
mein_mc.fadeIn(3);
[...]
|
| Prototype: Number.formatTausender 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 [...]
|
| swapDepths mit einem Rahmen, der oben bleibtDieses kleine Tut ist eine hoffentlich verständliche Komplettlösung des folgenden Problems:
http://flashhilfe.de/forum/flash/swapdepths-aber-ein-mc-muss-oben-bleiben-194796-194796.html
Die Lösungsidee:
man erstellt einen Container (MC), in de [...]
|
| Prototype: Movieclip.Prototyp._SHELLVariablenwerte 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.MoveObjectObject-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()15.09.2006 - 0 Kommentare - public 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()10.09.2006 - 0 Kommentare - public 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: getTotalTime10.09.2006 - 0 Kommentare - public 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 [...]
|
| Flash Hilfe F1Kleiner aber feiner Tip.
Wenn ihr in eurem Scriptfenster in Flash einen Befehl markiert und F1 drückt, so wird direkt die Hilfe zu dem Befehl aufgerufen!
oli
chess is a fun game, if played with shotguns!
|
| Prototype: patternFill03.08.2006 - 0 Kommentare - Sickdog 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: createRectangleMC03.08.2006 - 0 Kommentare - Sickdog 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.fitInto03.08.2006 - 0 Kommentare - Sickdog 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()21.03.2006 - 0 Kommentare - Vampire 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";
[...]
|
| Color- & Convolution- & TransformationMatrix LinksHier einige Links zur Verwendung der neuen Flash8 Matrix Klassen, mir fiel es bis jetzt immer etwas schwer mich damit anzufreunden, vielleicht gehts euch genauso:
http://www.macromedia.com/devnet/flash/articles/matrix_transformations.html
http: [...]
|
| xml von fremden server laden13.01.2006 - 0 Kommentare - sasasem ewig gesucht: neben den ueblichen Macromedia vorkehrungen kann man auch so das System aushebeln: http://www.actionscript.org/forums/showthread.php3?t=40745
sucht am ende nach
<?php
$contents =implode ("",file("http://www.server.com/news.xml")); [...]
|
| Prototype: MovieClip.setzeMauszeiger07.01.2006 - 0 Kommentare - Madokan Benutzerdefinierter Mauszeiger
// Benutzerdefinierte Mauszeiger
MovieClip.prototype.setzeMauszeiger = function (unsichtbar)
{
if (unsichtbar)
{
Mouse.hide ();
}
this.onMouseMove = function ()
{
this._x = _xmouse;
this._y = _ymo [...]
|
| Prototype: MovieClip.setzeMausverfolger07.01.2006 - 0 Kommentare - Madokan Benutzerdefinierte Mausverfolger
// Benutzerdefinierte Mausverfolger
MovieClip.prototype.setzeMausverfolger = function (tempo)
{
this.onEnterFrame = function ()
{
this._x += (_xmouse - this._x) / tempo;
this._y += (_ymouse - this._y) / [...]
|
| ExtendedMC KlasseHier mal ne kleine Klasse die den Umgang mit Tweens ein bissl erläutert, vielleicht hilfts jemandem :o)
import mx.transitions.Tween;
import mx.transitions.easing.*;
class com.sc.tests.flash8.ExtendedMovieClip extends MovieClip
{
private va [...]
|
| Cached Flash8 die mit Symbolen verknüpften Klassenmoin zusammen!
hab echt ein grosses problem mit flash8 (trial version)
ich hab ein mc (Verknüpfungsbezeichner = Uploader, AS2.0 Klasse Uploader)
in der Bibliothek. zunächst erstmal alles ok. der Film läuft auch fehlerfrei. Das PROBLEM ist a [...]
|
| Flash 8 (Eastereggs - Tutorial)21.09.2005 - 0 Kommentare - Madokan Hi Folks,
Hier haben wir noch was für Euch - das EasterEgg Tutorial zu Flash 8.
Natürlich haben sich die Damen und Herren aus dem sonnigen Californien nicht lumpen lassen und gleich zwei EasterEgg platziert.
Wir verrarten Euch, wie Ihr die [...]
|
| Flash 8 Publikation via Flash MX 200419.07.2005 - 2 Kommentare - Madokan
Fünf Schritte:
1. In Flash MX 2004 einen neuen Flash Film anlegen.
2. Einstellungen für Veröffentlichungen aufrufen.
3. Das im Anhang enthaltene Flash 8 Profil importieren
4. Im Reiter Flash überprüfen ob die Umstellung erfolgreich war - [...]
|
| Flash 8 Linksammlung14.07.2005 - 0 Kommentare - Madokan
Flash Player 8: http://www.macromedia.com/software/flashplayer/public_beta/
Flash Player 8 Bug report: http://www.macromedia.com/bin/fp8betafeedback.cgi
Convert2SWF8 - http://chall3ng3r.blogspot.com/2005/07/convert2swf8-now-available-for.ht [...]
|
| Prototype: MovieClip.fpsmeter_extended03.06.2005 - 0 Kommentare - Madokan 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: MovieClip.prototype.fpsmeter29.05.2005 - 0 Kommentare - Madokan FPS Meter (Anzeige)
MovieClip.prototype.fpsmeter = function ()
{
this.zaehler = 0;
this.onEnterFrame = function ()
{
this.zaehler++;
};
anzeigen = function ()
{
trace(this.zaehler);
this.z [...]
|
| Prototype: changeParamsmoothe 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.ZoomIntDiv16.05.2005 - 0 Kommentare - Madokan 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.ZoomIntDiv16.05.2005 - 0 Kommentare - Madokan 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.ZoomInt16.05.2005 - 0 Kommentare - Madokan 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.ZoomAdd16.05.2005 - 0 Kommentare - Madokan 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.ZoomPulsar16.05.2005 - 0 Kommentare - Madokan 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.ZoomDiv16.05.2005 - 0 Kommentare - Madokan 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._Depth16.05.2005 - 0 Kommentare - Madokan 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_extend23.04.2005 - 0 Kommentare - Madokan Erweiterte Version (Runden/Round)
// --------------------------------------------------------------------
// Number.prototype.runden_extended
//
// Definition: zahl.runden(Rundungsmodus, DezimalZeichen, Genauigkeit)
//
// pModus - Rundungsmodu [...]
|
| Prototype: Runden (Klasse Extended)23.04.2005 - 0 Kommentare - Madokan Erweiterte Version
// Runden.as
// --------------------------------------------------------------------
// Klasse: Runden (Extended)
//
// Definition: Runden.runden_extended(pZahl, Rundungsmodus, DezimalZeichen, Genauigkeit)
//
// pZahl [...]
|
| Prototype: Runden (Klasse)23.04.2005 - 0 Kommentare - Madokan Runden Klasse - ActionScript 2.0
// --------------------------------------------------------------------
// Klasse: Runden (Runden.as)
//
// Definition: Runden.runden_extended(pZahl, Rundungsmodus, DezimalZeichen, Genauigkeit)
//
// pZahl [...]
|
| Prototype: Number.prototype.runden_nat23.04.2005 - 0 Kommentare - Madokan Runden (Kurzfassung)
// --------------------------------------------------------------------
// Number.prototype.runden (round - shortversion)
//
// Definition: zahl.runden(Rundungsmodus, DezimalZeichen, Genauigkeit)
//
// pModus - Rundungsm [...]
|
| Prototype: Number.prototype.runden23.04.2005 - 0 Kommentare - Madokan Runden (Round) von Zahlen mit drei Modis
// --------------------------------------------------------------------
// Number.prototype.runden
//
// Definition: zahl.runden(Rundungsmodus, DezimalZeichen, Genauigkeit)
//
// pModus - Rundungsmodu [...]
|
| Prototype: Date.getFirstDayOfMonth09.01.2005 - 0 Kommentare - Madokan Erster Tag im Monat
// Erster Tag im Monat
Date.prototype.getFirstDayOfMonth = function() {
return ;
}
ASSetPropFlags(Date.prototype, "getFirstDayOfMonth", 1, true);
// Verwenden
datum = new Date();
ersterTag = datum.getFirstDayO [...]
|
| Prototype: Date.getQuarterOfYear09.01.2005 - 0 Kommentare - Madokan Quartal im Jahr
// Quartal im Jahr
Date.prototype.getQuarterOfYear = function()
{
return Math.floor(this.getMonth()/ 3)+1;
}
ASSetPropFlags(Date.prototype, "getQuarterOfYear", 1, true);
// Verwenden
datum = new Date();
trace(" [...]
|
| Prototype: Date.getMonthName09.01.2005 - 0 Kommentare - Madokan Monatsnamen (Bezeichnung)
// Monat (Bezeichnung)
Date.prototype.getMonthName = function(pMonat) {
return
}
ASSetPropFlags(Date.prototype, "getMonthName", 1, true);
// Verwenden
datum = new Date();
monat = datum.getMonth();
a [...]
|
| Prototype: Date.getDayName09.01.2005 - 0 Kommentare - Madokan Wochentag (Bezeichnung)
// Wochentag (Bezeichnung)
Date.prototype.getDayName = function(pTag) {
return
}
ASSetPropFlags(Date.prototype, "getDayName", 1, true);
// Verwenden
datum = new Date();
wochentag = datum.getDay();
// H [...]
|
| Prototype: Date.getLeapYear09.01.2005 - 0 Kommentare - Madokan Ermitteln von Schaltjahren
// Schaltjahr
Date.prototype.getLeapYear = function() {
return ((new Date(this.getFullYear(), 2, 0).getDate()) == 29 ? 1 : 0);
};
ASSetPropFlags(Date.prototype, "getLeapYear", 1, true);
// Verwenden
da [...]
|
| Prototype: Date.getPeriodOfYearHemisphere09.01.2005 - 0 Kommentare - Madokan Jahreszeiten (Nord/Süd-Halbkugel)
// Jahreszeiten für die nördliche und südliche Hemisphere
Date.prototype.getPeriodOfYearHemisphere = function(pSphere)
{
var monat = this.getMonth()+1;
var tag = this.getDate();
if (pSphere) [...]
|
| Prototype: Array.copyKopiert ein Array
Array.prototype.copy = function() {
return this.slice(0, this.length);
}
ASSetPropFlags(Array.prototype,"copy" , 1, true);
;
zweites_array = erstes_array.copy();
erstes_array.splice(0,2);
trace("erstes_array = " + erstes_ [...]
|
| Prototype: Number.roundToZahl aufrunden nach x
Number.prototype.roundTo = function(stellen) {
var d = Math.pow(10,stellen);
return Math.round(this * d) / d;
}
zahl = 213.545;
trace(zahl.roundTo(2)); // 213.55
|
| Prototype: Array.prototype.arrayToVar30.10.2004 - 5 Kommentare - Madokan Array Elemente in Variablen überführen.
// Array in Variablen umwandeln
Array.prototype.arrayToVar = function(varname) {
if (varname == undefined) varname = "variable";
for (var i = 0; i < this.length; i++) {
_root;
[...]
|
| Prototype: String.prototype.stringToArray30.10.2004 - 2 Kommentare - Madokan Zeichenketteninhalt in ein Array überführen.
// Zeichenkette in Array - inspired by Sebastian
String.prototype.stringToArray = function(trennzeichen) {
if (trennzeichen == undefined) trennzeichen = ",";
return this.split(trennzeichen) [...]
|
| Prototype: String.prototype.stringToVar30.10.2004 - 0 Kommentare - Madokan Zeichenketteninhalte in Variablen ablegen
// Zeichenkette in Variablen umwandeln
String.prototype.stringToVar = function(varname,trennzeichen) {
if (varname == undefined) varname = "variable";
if (trennzeichen == undefined) trennzeichen = ","; [...]
|
| Prototype: Math.precision20.10.2004 - 1 Kommentar - umlart Wert auf Dezimalstellen runden
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.precision (value, decimalPlaces)
//+
//+ returns the given value rounded to specified decimal places
//+++++++++++++++++++++++++++++ [...]
|
| Prototype: getPhoneticPasswordPhonetisches Passwort generieren
function getPhoneticPassword (pwdLen : Number) : String {
/*
Based on a ColdFusion-Script by Michael Hnat.
Translated to ActionScript 2.0 by Kai Jansen.
Modified by Kai Jansen.
*/
// get absolute Number [...]
|
| Prototype: Movieclip.leseTiefenHiermit können die belegten Tiefen ausgegeben werden
// leseTiefen Funktion
// - pMax bis zu welcher Tiefe soll analysiert werden
// - Gibt die belegten Tiefen aus + MocieClip Namen
MovieClip.prototype.leseTiefen = function(pMax) {
var liste [...]
|
| Prototype: Key.onEnterDown / onEnterUpEvent Handler für die Enter Taste
// onEnter
onEnterListener = {};
onEnterListener.onKeyDown = function() {
if(Key.getCode() == Key.ENTER) {
Key.broadcastMessage("onEnterDown");
}
}
onEnterListener.onKeyUp = function() {
if(Key.get [...]
|
| Prototype: Key.onEnterDown / onEnterUp v2Event Handler für die Enter Taste
// 'onEnterListener'- Objekt erstellen und als Event-Quelle freigeben:
onEnterListener = {};
ASBroadcaster.initialize(onEnterListener);
// Methoden u. Eigenschaften als Event-Quelle ueberpruefen:
/*
ASSetPr [...]
|
| Prototype: stristr (Original)Sucht das erste Vorkommenn eins Strings oder eines ASCII Codes RETURN: Restsring
String.prototype.stristr = function (needle) {
var str = this.toUpperCase();
index = (typeof(needle) == "string") ? str.indexOf(needle.toUpperCase()) : str.indexOf [...]
|
| Prototype: Array.indexOfGibt den ersten vorkommenden Index in einem Array zurück
Array.prototype.indexOf = function (s) {
var index = -1;
for (var i in this) {
if (this == s) {
index = i;
}
}
index = (isNaN(index)) ? index : Number(index);
return inde [...]
|
| Prototype: String.nreplaceDas n-te Zeichen eines Strings wird durch übergebenes Zeichen ersetzt
String.prototype.nreplace = function(pos, repchar)
{
return (this.substring(0, pos-1).concat(repchar, this.substring(pos, this.length)));
};
ASSetPropFlags(String.prototyp [...]
|
abgemeldeter Benutzer | Prototype: duplicate TextField08.06.2004 - 0 Kommentare - .cYe TextField.duplicate()
TextField.prototype.duplicate = function (instanceName:String, depth:Number) {
this._parent.createTextField(instanceName, depth, this._x, this._y, this._width, this._height);
this._parent.setNewTextFormat(this.getTextFo [...]
|
abgemeldeter Benutzer | Prototype: Array.addDim & Array.delDim25.05.2004 - 0 Kommentare - .cYe Helferchen zur Arbeit mit mehrdimensionalen Arrays.
// addDim fuegt ein oder mehrere Werte in einer neuen Dimension eines Arrays hinzu
Array.prototype.addDim = function() {
var arg, std = (arguments.length==1)? arguments : 0;
for(var [...]
|
| Prototype: removeTags30.04.2004 - 0 Kommentare - MoD Entfernt alle Tags aus einem String (XML-Variante)
//FLASH5-VERSION
string.prototype.removeTags=function()
{
var stringAsXML=new XML(this);
var ACTUALnode=stringAsXML.firstChild;
var DOstepNum=0;
var DONEstep;
var DONEsearching=false;
[...]
|
| Prototype: Color.FadeBrightness15.04.2004 - 0 Kommentare - ToBSn erzeugt einen \"glowartigen\" Fade
Color.prototype.changebrightness = function($brightness) {
var $transform = this.getTransform();
with ($transform) {
rb = gb=bb=$brightness;
}
this.setTransform($transform);
};
MovieClip.prototype.fad [...]
|
| Prototype: setSectionPointsTausender Punkte setzen
Math.setSectionPoints = function (z) {
var z1 = String(z).split(".");
if (z1.length <= 3) return z1.join(",");
var i_array = z1.split("").reverse();
var o_array = new Array();
o_array.push("," + z1);
var count = [...]
|
| Prototype: limitTextLengthZu langen Text mit \"...\" begrenzen
TextField.prototype.limitTextLength = function (myWidth) {
this.autoSize = "left";
var myFormat = this.getTextFormat();
var myText = this.text;
w = this.textWidth;
trace (w);
while (w > myWidth) {
[...]
|
| Prototype: MovieClip.colorFade03.03.2004 - 3 Kommentare - ToBSn MCs stufenloser Colorfade
MovieClip.prototype.colorFade = function(newHEX, speed) {
var myColor = new Color(this);
var cRGB = myColor.getRGB();
var cHEX = cRGB.toString(16);
this.onEnterFrame = function() {
if (cHEX<>ne [...]
|
| Prototype: AddZerosNullen hinzufügen für Punktestände
Number.prototype.addZeros = function(p) {
return new Array(p - length(this) + 1).join('0') + this;
};
// oder als Klasse:
Score = function (points) {
this.points = points;
};
Sco [...]
|
| Prototype: Array.unique04.02.2004 - 2 Kommentare - Madokan Entfernt doppelte Einträge aus einem Array
Array.prototype.unique = function() {
for (var i = 0; i < this.length; i++) {
for (var j = (i + 1); j <= this.length; j++) {
if (this) {
this.splice(j, 1);
}
}
}
};
// Verwenden
[...]
|
| Prototype: MovieClip.Typewriter01.02.2004 - 0 Kommentare - ToBSn Typewriterprototype
typeForm = new TextFormat();
typeForm.color = 0xBABABA;
typeForm.size = 20;
typeForm.font = "euerEMBEDFONT";
//
MovieClip.prototype.typeW = function(mcName, Tiefe, TposX, TposY, TposH, TposW, toType) {
var i = 0;
var j [...]
|
| Prototype: String.replace23.10.2003 - 0 Kommentare - Madokan Suchen und Ersetzen
String.prototype.replace = function(s, z) {
return unescape(escape(this).split(s).join(z));
};
ASSetPropFlags(String.prototype, "replace", 1, true);
// Verwendung
trace(inhalt = eingabe_txt.text.replace("%0D", "<b [...]
|
| Prototype: String.prestrSucht erstes Vorkommen des Suchstring und liefert alles was dvor steht
String.prototype.prestr = function(s) {
if (this.toLowerCase().indexOf(s.toLowerCase()) == -1) {
return false;
} else {
return this.substr(0,this.toLowerCase().indexOf [...]
|
| Prototype: Math.vectorFaceNormal08.10.2003 - 0 Kommentare - umlart Flächennormale errechnen
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorFaceNormal (Point1, Point2, Point3)
//+
//+ returns the face normal vector of a plane (or polygon, or face)
//+ described by three [...]
|
| Prototype: Math.vectorCross08.10.2003 - 0 Kommentare - umlart Kreuzprodukt zweier Vektoren
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorCross (vector1, vector2)
//+
//+ returns the cross product of the given vectors, that´s another
//+ vector perpendicular to bot [...]
|
| Prototype: Math.vectorDistance08.10.2003 - 0 Kommentare - umlart Distanz zwischen 2 Punkten berechnen
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorDistance (startPoint, endPoint)
//+
//+ returns the distance between two points
//++++++++++++++++++++++++++++++++++++++ [...]
|
| Prototype: Math.vectorAngle08.10.2003 - 0 Kommentare - umlart Winkel zwischen Vektoren errechnen
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorAngle (vector1, vector2)
//+
//+ returns the angle between two vectors
//+++++++++++++++++++++++++++++++++++++++++++++++++ [...]
|
| Prototype: Math.vectorDot08.10.2003 - 0 Kommentare - umlart Skalarprodukt zweier Vektoren
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorDot (vector1, vector2)
//+
//+ returns the dot product of the given vectors - in case of unit
//+ vectors that´s actually the [...]
|
| Prototype: Math.vectorNormalize08.10.2003 - 0 Kommentare - umlart Vektor normalisieren
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorNormalize (vector)
//+
//+ returns the normalized vector (that is, a vector of 1 unit length
//+ pointing in the direction of the given [...]
|
| Prototype: Math.vectorLength08.10.2003 - 0 Kommentare - umlart Vektorlänge berechnen
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorLength (vector)
//+
//+ returns the length of the vector
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Math [...]
|
| Prototype: Math.vectorDivide08.10.2003 - 0 Kommentare - umlart Vektordivision
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorDivide (vector, factor)
//+
//+ returns the vector divided by factor (that is, scales the
//+ length of the vector)
//+++++++++++++++++++++++ [...]
|
| Prototype: Math.vectorMultiply08.10.2003 - 0 Kommentare - umlart Vektormultiplikation
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorMultiply (vector, factor)
//+
//+ returns the vector multiplied by factor (that is, scales the
//+ length of the vector)
//++++++++++++ [...]
|
| Prototype: Math.vectorSubtract08.10.2003 - 0 Kommentare - umlart Vektorsubtraktion
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorSubtract (startPoint, endPoint)
//+
//+ returns the vector (or path) from start point to end point
//++++++++++++++++++++++++++++++++++++++ [...]
|
| Prototype: Math.vectorAdd08.10.2003 - 0 Kommentare - umlart Vektoraddition
/+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.vectorAdd (startPoint, vector)
//+
//+ adds the vector to the start point and returns the resulting
//+ end point (or target point)
//++++++++++++++ [...]
|
| Prototype: Math.pow308.10.2003 - 0 Kommentare - umlart Wert hoch drei (auch in Flash5)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.pow3 (value)
//+
//+ returns the 3rd power of given value like Math.pow(value, 3), but
//+ handles value<=0 in Flash5 where built-i [...]
|
| Prototype: Math.pow208.10.2003 - 0 Kommentare - umlart Wert hoch zwei (auch in Flash5)
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+ Math.pow2 (value)
//+
//+ returns the square of given value like Math.pow(value, 2), but
//+ handles value<=0 in Flash5 where built-in f [...]
|
| Prototype: Math.phi06.10.2003 - 0 Kommentare - X|ngu goldenen Schnitt berechnen
Math.phi = function(sum){
var fak = (1 + Math.sqrt(5)) / 2;
var b = sum / fak ;
var a = b / fak;
var arr = ;
return arr;
}
//gibt die beiden Teile eines Wertes im Verhältnis des goldenen Schnittes
//zur [...]
|
| Prototype: Movieclip.atmosphere05.10.2003 - 0 Kommentare - Madokan Atmosphere - Effekt
MovieClip.prototype.atmosphere = function(pObj, pAnzahl, pBreite, pHoehe) {
for (var i = 0; i<=pAnzahl; i++) {
this.attachMovie(pObj, "flocke"+i, i);
this._x = Math.round(Math.random()*pBreite);
this._y = Math.round(M [...]
|
| Prototype: Movieclip.Schnee05.10.2003 - 0 Kommentare - Madokan Schnee-Effekt
MovieClip.prototype.schnee = function(pObj,pAnzahl, pBreite, pHoehe) {
for (var i = 0; i<=pAnzahl; i++) {
this.attachMovie(pObj, "flocke"+i, i);
this.skal = 50+(Math.random()*100);
this.alpha = 20+(Math.random()*50);
thi [...]
|
| Prototype: MovieClip.setMatrix27.09.2003 - 0 Kommentare - Madokan Feldmatrix Effekt Prototype
MovieClip.prototype.setMatrix = function (pClip, pReihen, pSpalte, pDim, pDist, pFarbe, pAlpha, pAbstand, pMax, pMin, pMult, pFraktion) {
var tiefe;
for (var i = 0; i<pReihen; i++) {
for (var j = 0; j<pSpalte; j++ [...]
|
| Prototype: Array.maxLengthLänge des Arrays auf nr kürzen
Array.prototype.maxLength = function(i) {
if(i>0 && this.length>i) this.pop(), this.maxLength(i);
else if(i<0 && this.length>i*-1) this.shift(), this.maxLength(i);
}
;
ary.maxLength(4);
trace(ary); // a,b,c [...]
|
| Prototype: SharedObject.destroySharedObject löschen
// http://www.flashguru.co.uk
SharedObject.destroy = function(name){
var so = SharedObject.getLocal(name);
for(var i in so.data){
delete so.data;
}
so.flush();
}
|
| Prototype: Array.findRemoveEintrag suchen und entfernen!
Array.prototype.findRemove = function(removeEntry) {
return this.toString().split(removeEntry + ",").join("").split(",");
};
// Verwenden
liste = ;
liste = liste.findRemove("Matze");
trace(liste [...]
|
| Prototype: attachAbove / attachUnderTiefenmanagement der einfachen Art
/*
*
* COPYRIGHT MAX KLATTE, NUR FÜR NICHT KOMMERZIELLE NUTZUNG! (ansonten rücksprache);
*
* Diese Funtkion erleichtert ein "Tiefenmanegment" ohne den gebrauch von leveln.
* So wird auch Beispielsweise das [...]
|
| Prototype: MovieClip.onDoubleClickEvent Handler - Doppelklick
MovieClip.prototype.addProperty("onDoubleClick",function() {
return this.$onDoubleClick;
},function(f) {
this.__proto__ = DoubleClick.prototype;
this.$onDoubleClick = f;
ASSetPropFlags(this,,1,true);
}); [...]
|
| Prototype: Key.onShiftDown / onShiftUp23.07.2003 - 10 Kommentare - Madokan Globaler Event Handler für die Shift-Taste
// onSHIFTDown/Up - Inspired by Sebastian
// Durch das _global Objekt wird das ganze Zeitleisten
// unabhängig und zu einem Konstanten Event Handler
// Hinweis: Lässt sich beliebig auf weitere Taste [...]
|
| Prototype: Movieclip.simpleCircle20.07.2003 - 0 Kommentare - Madokan Einfacher Kreis mit lineTo()
// Der Trick funtzt prima das lineTo() zu missbrauchen.
// Die Untergrenze für die Verschiebung liegt bei
// 0.14999999999999999.
MovieClip.prototype.simpleCircle = function(pobj, ptiefe, pX, pY, pDicke, pFarbe, pDe [...]
|
| Prototype: String.removeHTMLEntfernt HTML Tags aus einem String
String.prototype.removeHTML = function() {
var temp = "", s;
while((s=this.indexOf("<"))!=-1) {
temp += this.substr(0,s);
this = this.substr(this.indexOf(">")+1);
}
return temp+this;
};
ASSetP [...]
|
| Prototype: String.trimSchneidet Leerzeichen und Steuerzeichen vor und hinter einem String ab.
String.prototype.trim = function() {
for (var i = 0; this.charCodeAt(i)<33; i++);
for (var j = this.length-1; this.charCodeAt(j)<33; j--);
return this.substring(i, j+1);
[...]
|
| Prototype: Array.lastIndexOf()Gibt den letzten vorkommenden Index aus einem Array zurück.
Array.prototype.lastIndexOf = function (s) {
var index = -1;
for (var i in this) {
if (this == s) {
index = i;
break;
}
}
index = (isNaN(index)) ? index : Number(ind [...]
|
| Prototype: Mouse.onDoubleClickEvent Handler - Doppelklick
dCListener = {};
dCListener.onMouseDown = function() {(t = getTimer()) < $a+250 ? Mouse.broadcastMessage("onDoubleClick") : $a = t;}
Mouse.addListener(dCListener);
ASBroadcaster.initialize(dCListener);
ASSetPropFlag [...]
|
| Prototype: transformEventgesteuerte Animation
MovieClip.prototype.transform = function( $tobj , $ref) {
//lokal ablegen
this.$tobj = $tobj;
this.$ref = $ref;
//transformieren
this.onEnterFrame = function() {
var count = 0;
for (var prop in this.$tobj) [...]
|
| Prototype: Movieclip.totalAction12.07.2003 - 0 Kommentare - Madokan Sämtliche MovieClips auf einmal Steuern
Movieclip.prototype.totalAction = function(op,val) {
this(val);
for (var i in this) {
if (typeof (this) == "movieclip") {
this.totalAction(op,val);
}
}
};
// Verwenden
this.totalAction [...]
|
| Prototype: String.wordwrapBricht die Zeilen nach einer bestimmten Anzahl mittels angegebenen Zeichen um
String.prototype.wordwrap = function(nr,br,cut) {
var i, l, nr=(!nr ? 75 : nr), temp="", laenge=Math.floor(this.length/nr), br=(br==undefined ? "\n" : br);
for(i=0;i< [...]
|
| Prototype: String.ucfirstSetzt das erste Zeichen eines Strings als Großbuchstabe um
String.prototype.ucfirst = function() {
return this.charAt(0).toUpperCase()+this.substr(1);
}
ASSetPropFlags(String.prototype,"ucfirst",1,true);
|
| Prototype: String.strrchrSucht letztes Vorkommen des gesuchten Zeichens und liefert den Reststring
String.prototype.strrchr = function(s) {
var temp;
if((temp = this.toLowerCase().lastIndexOf(s.toLowerCase())) == -1) return false;
return this.substr(temp);
}
ASSetP [...]
|
| Prototype: String.stristrSucht erstes Vorkommen des Suchstrings und liefert den Reststring
// Wie String.strstr, aber ohne Rücksicht auf Groß- bzw. Kleinschreibung
// String.strstr -> http://www.flashhilfe.de/go/prototype/lesen&id=24&kat=21
String.prototype.stristr [...]
|
| Prototype: String.strstrSucht erstes Vorkommen des Suchstrings und liefert den Reststring
String.prototype.strstr = function(s) {
var temp
if((temp = this.indexOf(s)) == -1) return false;
return this.substr(temp);
}
ASSetPropFlags(String.prototype,"strstr", [...]
|
| Prototype: String.repeatWiederholt eine String-Ausgabe
// Inspired by Madokan
// http://www.flashhilfe.de/go/prototype/lesen&kat=16&seite=0&id=11
String.prototype.repeat = function(nr) {
return new Array(nr+1).join(this);
}
ASSetPropFlags(String.prototype,"repeat [...]
|
| Prototype: String.reverseLiefert einen String in umgekehrter Reihenfolge
String.prototype.reverse = function() {
return this.split("").reverse().join("");
}
ASSetPropFlags(String.prototype,"reverse",1,true);
|
| Prototype: String.uniqidErstellt eine eindeutige ID
Array.prototype.find = function(eingabe) {
return (this.toString().split(eingabe).length > 1);
}
String.uniqid = function(nr) {
var str = "", b = "";
for(var i=0;i<nr;i++) {
b = random(36).toString(36);
[...]
|
| Prototype: Array.findFindet Eintrag im Array und gibt true zurück
Array.prototype.find = function(eingabe) {
for(var i in this) if(this === eingabe) return true;
return false;
}
ASSetPropFlags(Array.prototype,"find",1,true);
;
trace(test_ary.find("Fr 02.0 [...]
|
| Prototype: String.replaceSuchen und ersetzen
// #########################
// Für Flash MX:
// #########################
String.prototype.replace = function (s, j) {
return this.split(s).join(j);
}
ASSetPropFlags(String.prototype,"replace",1,true);
// #### [...]
|
| Prototype: String.toArrayText in Array umwandeln
// Inspired by Madokan
String.prototype.toArray = function() {
return this.split("");
};
ASSetPropFlags(String.prototype,"toArray",1,true);
// Zuweisung
text = "flashhilfe.de";
liste = text.toArray();
[...]
|
| Prototype: TextField.checkEmailEmail Adresse überprüfen
/*#####################################*/
/* Email - Check | Flash MX | 2003 */
/* Sebastian Wichmann */
/* Michael Holl (Holly) */
/* http://www.flashhilfe.de */
/ [...]
|
| Prototype: TextFormat.setFontAlternative Schriftauswahl
TextFormat.prototype.setFont = function() {
var suche = arguments.split(","), font_liste = (TextField.getFontList().toString()+",").toLowerCase();
for(var i=0;suche.length;i++) {
if(font_liste.indexOf(( [...]
|
| Prototype: String.shuffleString in zufälliger Reihenfolge sortieren
String.prototype.shuffle = function() {
var str = "", temp_str = this.split("");
while(temp_str.length) {
str += temp_str.splice(random(temp_str.length),1);
}
return str;
}
[...]
|
| Prototype: Math.zufallZwischen02.07.2003 - 0 Kommentare - Madokan Zufallswert zwischen min/max
// Zufallswert von pmin bis pmax
Math.zufallZwischen = function(pmin, pmax) {
return (pmin + Math.floor(Math.random() * (pmax - pmin + 1)));
};
// Verwenden
trace(Math.zufallZwischen(-5, 5));
|
| Prototype: String.dateToTimestampWandelt ein Datum-String in Timestamp um
String.prototype.dateToTimestamp = function(lang) {
var temp_str = this.split("."), temp_str_2 = temp_str.split(":");
return new Date(int(temp_str_2)).getTime();
}
// Optional "en" Angabe für englisc [...]
|
| Prototype: Array.randLiefert einen oder mehrere zufällige Einträge eines Arrays
Array.prototype.rand = function(nr,i,temp_ary,temp_ary_2) {
if(temp_ary.length == undefined) {
var i = 0, temp_ary = ;
for(var j in this) temp_ary_2.push(this);
}
i++;
if(i< [...]
|
| Prototype: Array.shuffleArray in zufälliger Reihenfolge sortieren
// ## Ohne Typ Umwandlung: ############################
function rand() {
return random(3)-1;
}
Array.prototype.shuffle = function() {
return this.sort(rand);
}
ASSetPropFlags(Array.prototy [...]
|
| Prototype: delete_allMehrere Variablen auf einmal löschen
// FH delete_all
//
// Copyright (C) 2003 Sebastian Wichmann :: sebastian at flashhilfe.de
// This Software is distributed under the GNU General Public License.
//
// http://www.flashhilfe.de
_ [...]
|
| Prototype: XMLSA 1.4XML Simple Array hilft auf einfache und intutive Weise.
/*---------------------------------------------------------------------------
XMLSA for Flash MX v1.4
-----------------------------------------------------------------------------
Created [...]
|
| Prototype: Array_unique();Entfernt doppelte Werte aus einem Array
// FH Array_unique
//
// Copyright (C) 2003 Sebastian Wichmann :: sebastian at flashhilfe.de
// This Software is distributed under the GNU General Public License.
//
// http://www.flashhilfe.de
[...]
|
| PHP Daten in Flash laden (LoadVars-Object etc.)Im // Flash 5 Variante
onClipEvent(load) {
// Daten senden
this.loadVariables("datei.php?cache=" + (new Date().getTime()));
}
onClipEvent(data) {
_root.textfeld_1 = this.inhalt_1; // Variable aus dem PHP Script einem Textfeld zuweise [...]
|
Hast Du einen interessanten Adobe Flash / Flex / AIR Tipp, Tutorial
oder Code Snippets den Du mit anderen teilen möchtest?
|
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News
Regeln & Bedingungen
|