var conteneurImage:Loader = new Loader(); var image:URLRequest = new URLRequest("av1.png"); conteneurImage.load(image); this.addChild(conteneurImage); conteneurImage.width = 60; conteneurImage.scaleY = conteneurImage.scaleX;
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionimport flash.display.*; import flash.net.URLRequest; import flash.events.Event; var container:Sprite = new Sprite(); addChild(container); var pictLdr:Loader = new Loader(); var pictURL:String = "av1.png" var pictURLReq:URLRequest = new URLRequest(pictURL); pictLdr.load(pictURLReq); pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded); function imgLoaded(event:Event):void { container.addChild(pictLdr.content); container.width = 50; }
pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded('',largeur)); function imgLoaded(event:Event,largeur):void { container.addChild(pictLdr.content); container.width = largeur; }