Bonjour !
Alors tout d'abord je tiens à préciser que je connais flash, mais suis une super super novice concernant actionscript...
En ce moment j'essaie de développer mon site. J'aimerais afficher en fond d'écran, une animation qui prendrait toute la fenêtre du navigateur, et qui se redimensionnerait en conservant ses proportions.
Pour un autre site j'avais utilisé ce script (qu'on retrouve sur plein de forums), qui fonctionne très bien mais seulement pour une image fixe :
import flash.display.BitmapData;
Stage.align = "TL";
Stage.scaleMode = "noScale";
var url:String = "contact.jpg";
Stage.addListener(this);
var mcSource:MovieClip = this.createEmptyMovieClip("mcSource", this.getNextHighestDepth());
var loader = new MovieClipLoader ();
loader.addListener (this);
loader.loadClip (url, mcSource);
function onLoadInit (mcSource:MovieClip)
{
mcSource._visible = false;
ratio = mcSource._width / mcSource._height;
width = mcSource._width;
height = mcSource._height;
var bitmap:BitmapData = new BitmapData(mcSource._width, mcSource._height, true);
bitmap.draw (mcSource);
mcSource.removeMovieClip();
delete mcSource;
//mcBackground = this.createEmptyMovieClip ("mcBackground", this.getNextHighestDepth ());
mcBackground.attachBitmap (bitmap, 1, "auto", true);
onResize ();
}
function onResize ()
{
if (Stage.width>Stage.height)
{
mcBackground._width = Stage.width;
mcBackground._height = mcBackground._width / ratio;
if (mcBackground._height<Stage.height)
{
mcBackground._height = Stage.height;
mcBackground._width = mcBackground._height * ratio;
}
}
if (Stage.height>Stage.width)
{
mcBackground._height = Stage.height;
mcBackground._width = mcBackground._height * ratio;
}
carte._x = Stage.width;
carte._y = Stage.height - Stage.height;
}
onResize ();
Donc voilà ma question :
serait-il possible de l'adapter pour afficher une animation ?Merci d'avance pour vos (j'espère nombreuses) réponses !
pp