Thanks Cor,
I do appreciate that, in leu though he did say "not everyone".

The reason I posted the code in that manner was because I felt "you" (whom ever it would be)
would need all the code to really assess this problem I am having.
Pardon me I am new to forums.

I have followed your responses to posts and seen how you work with peoples codes. You do like em chunky. :P I do understand and appreciate a form of etiquette with these forums though. So I learned from this how to better assess how I wanted to ask for help.
(which in turn helps me understand my code a little more
because I have to think about it more to explain it.. Win Win situation :D)

Anyhoo,
To put it short, because my code is trying to find the width and height from a dynamic image
that is loaded with this class, There is a hiccup.

The class loads a bitmap into a mc then deletes that mc and creates a blank new one to draw that bitmap into for smoothing purposes, my code is setting the previewW and previewH
to the background image that is in the MC before anything is loaded.
But, once the new image is loaded, the MC resizes to its new width and height. I need previewW and previewH to equal the new loaded image width and height.

----------------------------------
NOW, there is one thing that may not need all this chunk.
All I am really trying to do is smooth my dynamically loaded images and use a preloader. This class fit the bill when I was researching. There is probably always a better way.
----------------------------------

Hope this is more clear.

If you want to explain in AS3 then please do!!!
I love AS3 just haven't made the migration yet.
Kind of need to learn AS2 first... as you can see. :)
I can take that and reverse translate. so to speak.


Here is my code: (shortened & centralized) -


ImageLoader Class:



import com.martijndevisser.ImageLoader; //--- this is important to figure out problem. see attached

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);
// ------------ This is where the problem starts.
//---------------this equals the background before an image is loaded
};
checkLoader.onLoadComplete = function(target:MovieClip) {
   target = _root.stage_mc["LargePic" + ID].newPic.Image_mc;
// ------------ this is where I noticed the problem.
   target._width = target._width / 3;
   target._height = target._height / 3;
//-------this works fine and keeps the right width and ehight. Weird...
   _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);
// ------------ this is what I want to fix. the end in almost any of the previews loaded will NOT equal the start
};
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);


Best Regards to All,
Thank you for all help,

Karl DeSaulniers
Design Drumm
k...@designdrumm.com
http://designdrumm.com




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

Reply via email to