Not want to offend anyone!!!
But personally I don't agree with Jason.
I do like chunk of code to look at, try to help and also learn a lot from
it.

I am just not in to AS2.

Cor

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill,
Jason
Sent: vrijdag 10 april 2009 20:22
To: Flash Coders List
Subject: RE: [Flashcoders] Loading MC

No offense meant here, seriously, but this is a minor pet peeve of mine.
I think the reason people don't respond to questions like this is not
because they don't know the answer, it's because the poster wrote way
too much in the way of description and posted too much code for list
members to sort through, therefore looking at this post, the immediate
reaction of some (not all, but some) may be, I don't have time to look
through this - someone else will answer.  Consequently nobody answers.
I would recommend making your posts more succinct.  You'll find more
success that way, and by really thinking about the core issue and
whittling it down, you may even come up with the answer (this happens to
me all the time - just writing out the problem in a succinct manner
helps me to find the answer, so I cancel posting the question).  You're
posting a lot of code that is irrelevant to the question.  No offense
meant... just hoping this helps to get help.


Jason Merrill 

Bank of  America   Learning Performance Solutions Instructional
Technology & Media   
Monthly meetings on the Adobe Flash platform for rich media experiences
- join the Bank of America Flash Platform Community 




-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Karl
DeSaulniers
Sent: Friday, April 10, 2009 12:42 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Loading MC

Still need some help with this. Anyone?

Sent from losPhone

On Apr 3, 2009, at 5:03 AM, Karl DeSaulniers <k...@designdrumm.com>  
wrote:

> Hello all and good morning,
> I was wondering if I could get some help on this.
> I have been trying for days now to figure this out.
> I know there is some little thing I am missing
> and its probably right under my nose so to speak.
>
> Here is my code:
>
> //--------------------------------------------------
> // Start Image loader
> //--------------------------------------------------
>
> import com.martijndevisser.ImageLoader;
>
> _root.stage_mc.attachMovie("LargePic","LargePic" +  
> ID,this.getNextHighestDepth());
> _root.stage_mc["LargePic" + ID].ID = ID;
> _root.stage_mc["LargePic" + ID]._x = originalX;
> _root.stage_mc["LargePic" + ID]._y = originalY;
> var mcProgress:Number = 0;
>
> var checkLoader:Object = new Object();
> checkLoader.onLoadStart = function(target:MovieClip):Void  {
>    trace("Start Width:" + _root.stage_mc["LargePic" + ID].previewW);
>    trace("Start Height:" + _root.stage_mc["LargePic" + ID].previewH);
>    _root.stage_mc["LargePic" + ID].newPic.spiralLoader._visible =  
> true;
>    _root.stage_mc["LargePic" + ID].newPic.spiralLoader.gotoAndPlay(2);
> };
> checkLoader.onLoadComplete = function(target:MovieClip) {
>    target = _root.stage_mc["LargePic" + ID].newPic.Image_mc;
>    _root.stage_mc["LargePic" + ID].newPic.percentCom.text = "";
>    _root.stage_mc["LargePic" + ID].newPic.spiralLoader.stop();
>    _root.stage_mc["LargePic" + ID].newPic.spiralLoader.gotoAndStop(1);
>    _root.stage_mc["LargePic" + ID].newPic.spiralLoader._visible =  
> false;
>    target._width = target._width / 3;
>    target._height = target._height / 3;
>    _root.stage_mc["LargePic" + ID].previewW =  
> _root.stage_mc["LargePic" + ID].newPic._width;
>    _root.stage_mc["LargePic" + ID].previewH =  
> _root.stage_mc["LargePic" + ID].newPic._height;
>    trace("End Width:" + _root.stage_mc["LargePic" + ID].previewW);
>    trace("End Height:" + _root.stage_mc["LargePic" + ID].previewH);
> };
> checkLoader.onLoadProgress = function(target:MovieClip,  
> bytesLoaded:Number, bytesTotal:Number):Void  {
>    mcProgress = Math.ceil((bytesLoaded / bytesTotal) * 100);
>    _root.stage_mc["LargePic" + ID].newPic.percentCom.text =  
> mcProgress.toString() + "%";
> };
> var loader:ImageLoader = new ImageLoader(_root.stage_mc["LargePic" +  
> ID].newPic.Image_mc);
> loader.addListener(checkLoader);
> loader.loadImage(_global.projectPic,_root.stage_mc["LargePic" +  
> ID].newPic.Image_mc);
>
> //--------------------------------------------------
> // End Image Loader
> //--------------------------------------------------
>
>
> To explain further, I have a oversized image loading at first which  
> is sized down 3 times.
> Once it sizes down, I want previewW and previewH to equal the new  
> width and height.
> Everything loads fine, it loads and the progress runs and it resizes  
> fine,
> but when I hit my resize button to make it smaller, the variables  
> previewW and previewH
> take on the dimensions of _root.stage_mc["LargePic" +  
> ID].newPic.Image_mc  before anything was loaded into it.
> (my resize button works off of the previewW and previewH vairables,  
> this info is just FYI)
> var fitSizeW:Number = previewW;
> var fitSizeH:Number = previewH;
> var maxSizeW:Number = (previewW * 3);
> var maxSizeH:Number = (previewW * 3);
> var minSizeW:Number = (previewW / 3);
> var minSizeH:Number = (previewH / 3);
>
> Note: I have to keep previewW and previewH also because I have a  
> mousescroll attached to that variable as well.
>
> I have a feeling that because the ImageLoader class loads a dummy MC  
> for the bitmap
> and then removes it to place the "img" MC for smoothing, my script  
> is not getting the final value
> of what is loaded into it and so previewW and previewH do not  
> inherit its final values, just its beginning values.
> There is a background bitmap that gets replaced by the loaded image  
> that is in the MC when it is placed on stage.
> This is the beginning value.
>
> This is in AS2 BTW.
>
> Any help would be GREATLY appreciated at this point.
>
> THX
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
> _______________________________________________
> 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
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.287 / Virus Database: 270.11.51/2052 - Release Date: 04/10/09
06:39:00

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

Reply via email to