Actionscript 3 için oldukca basit bir preloading
this.onEnterFrame = function() {
this._x = Math.sin(a)*staerke+100;
this._y = Math.cos(a)*staerke+100;
a++>=10 ? a=0 : null();
};
};
//usage;
mc3.vibration(1);
MovieClip.prototype.ZoomDiv = function (pDim, pTempo)
{
this.onEnterFrame = function ()
{
if (this._xscale < pDim - 1 / pTempo)
{
this._xscale = this._xscale + (pDim - this._xscale) / pTempo;
this._yscale = this._yscale + (pDim - this._yscale) / pTempo;
}
else if (this._xscale > pDim + 1 / pTempo)
{
this._xscale = this._xscale + (pDim - this._xscale) / pTempo;
this._yscale = this._yscale + (pDim - this._yscale) / pTempo;
}
else
{
this._xscale = this._yscale = pDim;
delete this.onEnterFrame;
}
};
};
ASSetPropFlags(MovieClip.prototype, "ZoomDiv", 1);
// Usage
mc3.onRollOver = function ()
{
this.ZoomDiv (200, 6);
};
mc3.onRollOut = function ()
{
this.ZoomDiv (100, 6);
};
Otomatil zoom için prototype
{
if (pOption)
{
this.onEnterFrame = function ()
{
if (this._xscale < pDim)
{
this._xscale = this._yscale += pTempo;
}
else
{
this._xscale = this._yscale = pDim;
delete this.onEnterFrame;
}
};
}
else
{
this.onEnterFrame = function ()
{
if (this._xscale > pDim)
{
this._xscale = this._yscale -= pTempo;
}
else
{
this._xscale = this._yscale = pDim;
delete this.onEnterFrame;
}
};
}
};
ASSetPropFlags(MovieClip.prototype, "ZoomAdd", 1);
// Useage
mc3.onRollOver = function ()
{
this.ZoomAdd (true, 200, 6);
// ZoomIn (true)
};
mc3.onRollOut = function ()
{
this.ZoomAdd (false, 100, 6);
// ZoomOUt (false)
};
Actionscript ile style verme ve text olusturma Creating TextField by AS
_root.createTextField("newField",1,100,100,300,300);
with (newField){
background = true;
backgroundColor=0×8888FF;
border = true;
borderColor = 0×000000;
autoSize = "left";
wordWrap = true;
text = currentField.text
}
/* From Macromedia’s livedocs:
The default properties of a text field are as follows:
type = "dynamic"
border = false
background = false
password = false
multiline = false
html = false
embedFonts = false
variable = null
maxChars = null
A text field created with createTextField() receives the following default TextFormat object:
font = "Times New Roman"
size = 12
textColor = 0×000000
bold = false
italic = false
underline = false
url = ""
target = ""
align = "left"
leftMargin = 0
rightMargin = 0
indent = 0
leading = 0
bullet = false
tabStops = [] (Empty Array)
*/
newFormat = new TextFormat();
with(newFormat){
color = 0×000000;
font = "Verdana";
bold = true;
size = 10;
}
newField.setTextFormat(newFormat);
currentField.onChanged = function(){
_root.newField.setNewTextFormat(_root.newFormat);
_root.newField.text = this.text;
}
Flash’ın Kendi tween classının kolaylastırılmıs ve optimize edilmiş halı oldukca basit kulanıslı kb olarak yer kaplamıyor. Kulanım ornekleri ve link devamında..
