Difference between revisions of "Load Family of Images with Modulus"
From scripting
(Created page with " var myImageHolder = createEmptyMovieClip("myImageHolder", 50); var $totalImages = 113; //total minus one var $randval = int((Math.random()*$totalImages)+1); myImageHold...") |
(No difference)
|
Latest revision as of 07:15, 22 April 2017
var myImageHolder = createEmptyMovieClip("myImageHolder", 50); var $totalImages = 113; //total minus one var $randval = int((Math.random()*$totalImages)+1); myImageHolder.loadMovie("Images/"+$randval+".jpg"); myImageHolder._x = 20; myImageHolder._y = 20; f(); function f() { onEnterFrame = function () { if (myImageHolder._width) { delete this.onEnterFrame; $XDIM = myImageHolder._width ; $YDIM = myImageHolder._height ; $FinalY = 480//( $FinalX / $XDIM ) * $YDIM ; $FinalX = ( $FinalY / $YDIM ) * $XDIM; $FPerc = Math.round(100 * ($FinalY / $YDIM)); myImageHolder._xscale = $FPerc; myImageHolder._yscale = $FPerc ; } }; }