Re: [Flashcoders] Loading MC

2009-04-10 Thread Karl DeSaulniers

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


RE: [Flashcoders] Loading MC

2009-04-10 Thread Merrill, Jason
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

Re: [Flashcoders] Loading MC

2009-04-10 Thread Karl DeSaulniers

Ah duly noted.
I will figure it out myself then.
Sorry to all who were inconveniened.

Sent from losPhone

On Apr 10, 2009, at 1:21 PM, Merrill, Jason jason.merr...@bankofamerica.com 
 wrote:


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

RE: [Flashcoders] Loading MC

2009-04-10 Thread Kerry Thompson
Karl DeSaulniers wrote:

 Ah duly noted.
 I will figure it out myself then.
 Sorry to all who were inconveniened.

I don't think it was really an inconvenience to anybody. I think Jason
wasn't so much criticizing you as pointing out the best way to get answers
from the group.

In other words, whittle it down to a specific code portion, describe the
issue succinctly, and we're glad to help. You original post was just a case
of TMI ^_^

Think about it. How often do you read beyond the 2nd or 3rd paragraph of a
long post?

Kids these days. No attention span ;-)

Cordially,

Kerry Thompson

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


Re: [Flashcoders] Loading MC

2009-04-10 Thread Karl DeSaulniers
I understand. No problems. I will try to figure out how to simplify my  
question.



Sent from losPhone

On Apr 10, 2009, at 3:44 PM, Kerry Thompson  
al...@cyberiantiger.biz wrote:



Karl DeSaulniers wrote:


Ah duly noted.
I will figure it out myself then.
Sorry to all who were inconveniened.


I don't think it was really an inconvenience to anybody. I think Jason
wasn't so much criticizing you as pointing out the best way to get  
answers

from the group.

In other words, whittle it down to a specific code portion, describe  
the
issue succinctly, and we're glad to help. You original post was just  
a case

of TMI ^_^

Think about it. How often do you read beyond the 2nd or 3rd  
paragraph of a

long post?

Kids these days. No attention span ;-)

Cordially,

Kerry Thompson

___
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] Loading MC

2009-04-05 Thread Hans Wichman
Hi Karl,

your best bet is probably to checkout the imageloader source from martijn de
visser that you are using, and adapt that to be able to get at the values
you want.

Maybe this works:
 target._width = target._width / 3;
 target._height = target._height / 3;
 _root.stage_mc[LargePic + ID].previewW = target._width;
 _root.stage_mc[LargePic + ID].previewH = target._height;

regards,
JC

On Fri, Apr 3, 2009 at 12:03 PM, Karl DeSaulniers k...@designdrumm.comwrote:

 Hello,
 I was wondering if anyone can point me in the rigth direction.

 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


Re: [Flashcoders] Loading MC

2009-04-05 Thread Karl DeSaulniers
Hey thanks for your thoughts. Do you mean take the code out of the  
class and put it directly in my fla?


Karl

Sent from losPhone

On Apr 5, 2009, at 10:20 AM, Hans Wichman j.c.wich...@objectpainters.com 
 wrote:



Hi Karl,

your best bet is probably to checkout the imageloader source from  
martijn de
visser that you are using, and adapt that to be able to get at the  
values

you want.

Maybe this works:
target._width = target._width / 3;
target._height = target._height / 3;
_root.stage_mc[LargePic + ID].previewW = target._width;
_root.stage_mc[LargePic + ID].previewH = target._height;

regards,
JC

On Fri, Apr 3, 2009 at 12:03 PM, Karl DeSaulniers k...@designdrumm.com 
wrote:



Hello,
I was wondering if anyone can point me in the rigth direction.

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

___

Re: [Flashcoders] Loading MC

2009-04-05 Thread Hans Wichman
Hi,

erm no that's not what I said:).

Just read the original source file to deduct where it goes wrong, or try out
the replacement I suggested in your own code.

regards,
JC

On Mon, Apr 6, 2009 at 12:24 AM, Karl DeSaulniers k...@designdrumm.comwrote:

 Hey thanks for your thoughts. Do you mean take the code out of the class
 and put it directly in my fla?

 Karl

 Sent from losPhone


 On Apr 5, 2009, at 10:20 AM, Hans Wichman j.c.wich...@objectpainters.com
 wrote:

 Hi Karl,

 your best bet is probably to checkout the imageloader source from martijn
 de
 visser that you are using, and adapt that to be able to get at the values
 you want.

 Maybe this works:
 target._width = target._width / 3;
 target._height = target._height / 3;
 _root.stage_mc[LargePic + ID].previewW = target._width;
 _root.stage_mc[LargePic + ID].previewH = target._height;

 regards,
 JC

 On Fri, Apr 3, 2009 at 12:03 PM, Karl DeSaulniers k...@designdrumm.com
 wrote:

 Hello,
 I was wondering if anyone can point me in the rigth direction.

 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] Loading MC

2009-04-04 Thread Karl DeSaulniers

Hello,
I was wondering if anyone can point me in the rigth direction.
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] Loading MC

2009-04-03 Thread Karl DeSaulniers

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