Math pow [AS 2]
Klasa: Math
Kompatybilność: ActionScript 1.0, Flash 5+
pow(x:Number, y:Number) : Number
Oblicza oraz zwraca x do potęgi y.
Listing
this.tworzKlipFilmowy("figura_mc", this.getNextHighestDepth());
var sluchacz:Object = new Object();
sluchacz.onMouseDown = function() {
this.origX = _xmouse;
this.origY = _ymouse;
};
sluchacz.onMouseUp = function() {
this.newX = _xmouse;
this.newY = _ymouse;
var minY = Math.min(this.origY, this.newY);
var glebokosc:Number = figura_mc.getNextHighestDepth();
var linia_mc:MovieClip = figura_mc.createEmptyMovieClip("linia"+glebokosc+"_mc", glebokosc);
line_mc.moveTo(this.origX, this.origY);
line_mc.lineStyle(2, 0x000000, 100);
line_mc.lineTo(this.newX, this.newY);
var hypLen:Number = Math.sqrt(Math.pow(linia_mc._width, 2)+Math.pow(line_mc._height, 2));
linia_mc.createTextField("dlugosc"+glebokosc"_txt", figura_mc.getNextHighestDepth(), this.origX, this.origY-22, 100, 22);
linia_mc['dlugosc'+glebokosc+'_txt'].text = Math.round(hypLen) +" pikseli";
};
Mouse.addListener(sluchacz);
var sluchacz:Object = new Object();
sluchacz.onMouseDown = function() {
this.origX = _xmouse;
this.origY = _ymouse;
};
sluchacz.onMouseUp = function() {
this.newX = _xmouse;
this.newY = _ymouse;
var minY = Math.min(this.origY, this.newY);
var glebokosc:Number = figura_mc.getNextHighestDepth();
var linia_mc:MovieClip = figura_mc.createEmptyMovieClip("linia"+glebokosc+"_mc", glebokosc);
line_mc.moveTo(this.origX, this.origY);
line_mc.lineStyle(2, 0x000000, 100);
line_mc.lineTo(this.newX, this.newY);
var hypLen:Number = Math.sqrt(Math.pow(linia_mc._width, 2)+Math.pow(line_mc._height, 2));
linia_mc.createTextField("dlugosc"+glebokosc"_txt", figura_mc.getNextHighestDepth(), this.origX, this.origY-22, 100, 22);
linia_mc['dlugosc'+glebokosc+'_txt'].text = Math.round(hypLen) +" pikseli";
};
Mouse.addListener(sluchacz);
Dodano przez: divix
Ranga: Administrator serwisu Punktów: 0
Ranga: Administrator serwisu Punktów: 0
Komentarze użytkowników
:: Losowe artykuły
:: Wymiana linków
Modowe inspiracje |
Android Gry i Aplikacje |
ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
Logo dla firmy |
Change Tires - Car Weather Forecast Reminder |
Laminas: MVC Framework for PHP |
IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS |
Katalog roślin |
Programming articles: JAVA, PHP, C++, Python, JavaScript |
Kancelaria Adwokacka Łukasz Huszno