| Ultrashock Forums
the right way to allow smoothing for loaded .jpg's |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
4 Creative Assets
|
2009-06-25
#2 |
||
|
|
2009-06-25
#3 |
||
|
hi Laveklint. sorry, that's no good, gives me this error: Error: Error #2069: The Loader class does not implement this method. at Error$/throwError() at flash.display::Loader/addChild() at ArrayStuff/doneLoading() ![]() thanks felisan |
|
4 Creative Assets
|
2009-06-25
#4 |
||
sorry about that.. donīt know what I was thinking about.try this instead: Code:
// create a new sprite that will hold the loaded image
var _imageContainer:Sprite = new Sprite();
var _loader:Loader;
var _loaderArray:Array = [];
var _picture:String = "billeder/h1.jpg";
loadPicture(_picture);
function loadPicture(s:String) {
var picture:String = s;
_loader = new Loader();
_loader.alpha = 1;
_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showLoading);
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoading);
_loader.load(new URLRequest(picture));
}
function showLoading(e:Event):void {
trace("preloading");
}
function doneLoading(e:Event):void {
var bit:Bitmap = e.target.content as Bitmap;
bit.smoothing = true;
// this line will add the loaded content to the _imageContainer-sprite
_imageContainer.addChild( bit );
_loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, showLoading);
_loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, doneLoading);
}
|
|
|
2009-07-04
#5 |
||
|
thanks! anyway, project ended, and I have summed a bit up here: http://www.campjohn.dk/wp/?p=996 I'm not sure how useful it really is, but I know that I in the future will try to combine moving pictures like that with the "Ken Burns" effect to hopefully make it smoother. kind regards felisan |
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


4 comments
| 195 views


4 Creative Assets

sorry about that.. donīt know what I was thinking about.
Linear Mode
try this
function doneLoading(e:Event):void { var bit:Bitmap = e.target.content as Bitmap; bit.smoothing = true; _loader.addChild( bit ); addChild(_loader); _loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, showLoading); _loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, doneLoading); }