all groups > flash actionscript > march 2006 >
You're in the

flash actionscript

group:

Load and Resize JPEG image - almost working


Re: Load and Resize JPEG image - almost working DMennenoh
3/28/2006 7:04:09 PM
flash actionscript:
This comes up quite often... your code is executing before the clip has a
chance to load. You want to be using the MovieClipLoader class. That has the
onLoadInit event that fires once the clip is completely downloaded - in
there is where you want to resize it. You can use the class as simply as
this:

var myLoader = new MovieClipLoader();
var myListener = new Object();

myListener.onLoadInit = function(target:MovieClip){
target._x - 206;
target._y = 32;
target._width = 320;
target._height = 240;
}

myLoader.addListener(myListener);
myLoader.loadClip("some.swf", holderMC);

Using this class, you also get the onLoadProgress event which makes it very
easy to build progress bars for.


--
Dave -
Adobe Community Expert
www.blurredistinction.com
www.macromedia.com/support/forums/team_macromedia/

Load and Resize JPEG image - almost working General ZOD
3/28/2006 11:50:39 PM
I think that I'm close, I can position the new MC on the stage ok and it does
sort of resize, but I just can't get this to work.

_root.createEmptyMovieClip("holderMC",1);
_root.holderMC.loadMovie(myArray);

_root.holderMC._x = 205.9;
_root.holderMC._y = 32;
_root.holderMC._xscale = 320;
_root.holderMC._yscale = 240;

Re: Load and Resize JPEG image - almost working General ZOD
3/29/2006 1:43:26 AM
AddThis Social Bookmark Button