Re: [Flashcoders] Resizing Imported Images

2005-11-09 Thread Ian Thomas
Ah, didn't know that about _xscale and _yscale - thanks, Fumio, that's
useful to know...

Cheers,
Ian

On 11/9/05, Fumio Nonaka <[EMAIL PROTECTED]> wrote:
>
> Most of MovieClip's properties are initialized when an external file is
> loaded into it. But some properties including _x, _y, _xscale, and
> _yscale will hold their value. Of course if you would like to calculate
> its scales based on the external file's actual size, you should do it
> after it is fully loaded.
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Fumio Nonaka
Most of MovieClip's properties are initialized when an external file is 
loaded into it.  But some properties including _x, _y, _xscale, and 
_yscale will hold their value.  Of course if you would like to calculate 
its scales based on the external file's actual size, you should do it 
after it is fully loaded.

_
Ian Thomas wrote:

You need to do the resizing after the image has fully loaded. The trouble is
if you just set the _xscale and _yscale (for example) and then call
.loadMovie(), the 'new movie' (the image) replaces all the attributes of the
old movie and you lose your _xscale and _yscale values.


Good luck,

Fumio Nonaka
Phone: +81-42-397-9452
Fax: +81-42-397-9452
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
My books
Flash community

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Lehr, Theodore M.
Forgive me I am going to break the sacred double posting rule :  ) but I
did not get a eply on the newbie list and this thread has already been
started here

Here's what I am trying - and I get the width at 65 each time it is
traced, and yet I still see the full image (ie 250x400)

ccnt=0;
rowy=10;
rowx=40;
for (i=0; i<26; i++) {
if (ccnt==7) {
ccnt=0;
rowy+=75;
rowx=40;
}
duplicateMovieClip (_root.tnHolder, "mc"+i, i+100);
setProperty ("mc"+i, _x, rowx);
setProperty ("mc"+i, _y, rowy);
this["mc"+i].loadMovie("gallery/"+i+".jpg");
trace(this["mc"+i]+" width = "+this["mc"+i]._width);
this["mc"+i].onLoad = function(){
this["mc"+i]._width=65;
this["mc"+i]._height=65;
}
  trace(this["mc"+i]+" width = "+this["mc"+i]._width);
ccnt++;
rowx+=75;
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andreas
Weber
Sent: Tuesday, November 08, 2005 9:12 AM
To: Flashnewbie Mailing List
Subject: RE: [Flashnewbie] Resizing Imported jpg

As soon as the image is loaded into the clip, the size of the clip will
adapt to the size of the image.
Therefore you have to store the original size of the clip, wait until
the loading is finished and then reassign the stored dimensions to the
clip:

myClipWidth = myClip._width;
myClipHeight = myClip._height;

this.createEmptyMovieClip('monitor', this.getNextHighestDepth());
monitor.onEnterFrame = function(){
var loaded = myClip.getBytesLoaded();
var total = myClip.getBytesTotal();
trace(_root.myClip+'gugus '+loaded);
if(loaded > 14 && loaded >= total){
myClip._width  = myClipWidth;
myClip._height = myClipHeight;
this.removeMovieClip();
}
}

myClip.loadMovie('BlueHills.jpg');

hth
--
Andreas Weber
motiondraw.com



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Lehr,
Theodore M.
Sent: Tuesday, November 08, 2005 2:59 PM
To: Flashnewbie Mailing List
Subject: [Flashnewbie] Resizing Imported jpg


I am importing a jpg via load movie and I want to resize it... Say for
example I the jpg is 500x500 and the clip I am loading it into is 65X65
- after I import it it retains it's real size - how can I get it to
match the size of the movie it is loaded into?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Ian Thomas
*sigh*

var mcl:MovieClipLoader();


should be

var mcl:MovieClipLoader=new MovieClipLoader();


Ian
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Ian Thomas
You need to do the resizing after the image has fully loaded. The trouble is
if you just set the _xscale and _yscale (for example) and then call
.loadMovie(), the 'new movie' (the image) replaces all the attributes of the
old movie and you lose your _xscale and _yscale values.

If you're using MovieClipLoader, for example, you need to do the resizing in
onLoadComplete() or onLoadInit().

For example, something like this (from memory, so forgive typos):

var clip:MovieClip=createEmptyMovieClip("blank",getNextHighestDepth());
var mcl:MovieClipLoader();
var listener:Object=new Object();
listener.onLoadInit()=Delegate.create(this,onGraphicLoaded);
mcl.addListener(listener);
mcl.loadClip("myClip.jpg",clip);

function onGraphicLoaded(clip:MovieClip)
{
clip._xscale=50;
clip._yscale=50;
}

HTH,
Ian

On 11/8/05, Lehr, Theodore M. <[EMAIL PROTECTED]> wrote:
>
> I don't mind resizing the one it is loading into but I can not get it to
> work... I tried but it remains the size of the image...
>
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Martin Wood

are you waiting until the image is loaded before manipulating the movieclip?

the MovieClipLoader class may be useful if you arent using it (or a 
suitable alternative)


martin

Lehr, Theodore M. wrote:

I don't mind resizing the one it is loading into but I can not get it to
work... I tried but it remains the size of the image...


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Lehr, Theodore M.
I don't mind resizing the one it is loading into but I can not get it to
work... I tried but it remains the size of the image...

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Adrian
Lynch
Sent: Tuesday, November 08, 2005 9:24 AM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Resizing Imported Images

Load it into a nested MC and resize that instead? Why don't you want to
resize the MC it's being loaded into?

Ade

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Lehr,
Theodore M.
Sent: 08 November 2005 14:13
To: Flashcoders mailing list
Subject: [Flashcoders] Resizing Imported Images


Is there anyway to resize an image imported via loadMovie - not resizing
the mc it is loaded into - but the image itself?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Adrian Lynch
Load it into a nested MC and resize that instead? Why don't you want to
resize the MC it's being loaded into?

Ade

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Lehr,
Theodore M.
Sent: 08 November 2005 14:13
To: Flashcoders mailing list
Subject: [Flashcoders] Resizing Imported Images


Is there anyway to resize an image imported via loadMovie - not resizing
the mc it is loaded into - but the image itself?

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Resizing Imported Images

2005-11-08 Thread Martin Wood

no, once its loaded in the mc is the image.

you can always use another mc as a container if you require it.

martin


Lehr, Theodore M. wrote:

Is there anyway to resize an image imported via loadMovie - not resizing
the mc it is loaded into - but the image itself?
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--
want to know what i think? probably not

http://relivethefuture.com/choronzon
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders