Re: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread Éric Thibault

Thanks erery one for all the solutions and support

I'll put a note in my component that the centering function can 
sometimes produce indesirable results depending on the SWF loaded.  I'll 
strongly suggest to activate my mask option and align top-left to make 
sure everything is OK...


As for my own SWF, i'll go with Ryan's solution.

Thanks again!

Ryan Potter wrote:


Eric-

I have run into the same problem before.  the only way I found to force a clip 
to have a certain dimension is to put a graphic in at the size you want the 
clip to be.  I realize that you don't have control over the swfs that are being 
created but I have never been able to solve this either.  The width and height 
of the clip always equate to the width and height of the content in the clip.

The Only way I have been able to solve this is to use onLoadInit and set vars 
on the child that state the width and height explicitly.  But this requires 
having access to the fla.

Child Swf in the first frame:
this.w = 300;
this.h = 300;

Parent centering function called from the loader.onLoadInit

function centerClip(clip){
var w = clip.w;
var h = clip.h;
clip._x = Stage.width/2-(w/2);
clip._y = Stage.height/2-(h/2);
}



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Éric Thibault
Sent: Friday, February 03, 2006 9:06 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] LoadClip and centering new content

I already do that... but the width and height of the container clip 
takes into account any instances outside the boundary of the loaded 
SWF's stage...
So I'm getting the total with and height but want only the stage 
dimentions of the loaded SWF!


I want to align the loaded SWF'stage in the loading flash

If it was just for me, i would not put anything outside the stage of the 
loaded SWF but I'm not the producer of those swf...


And having the stage dimentions would help because the loaded SWF's 
dimentions only takes into account the instances present on frame 1... 
(mc_square 100*100 at (0,0) on a stage of 300*300 results in a container 
clip of 100*100!)


A+

j.c.wichman wrote:

 


Hi,
If you use something like:
var my_mcl:MovieClipLoader = new MovieClipLoader();

var myListener:Object = new Object();

myListener.onLoadInit = function(target_mc:MovieClip) {
  trace(target_mc._width);
		}; 
		my_mcl.addListener(myListener);

my_mcl.loadClip(, _root.dummy);

It should trace the width of your clip upon load. Is that what you mean?

Greetz
Hans

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Éric
Thibault
Sent: Friday, February 03, 2006 3:11 PM
To: Flashcoders Mailing List
Subject: RE:[Flashcoders] LoadClip and centering new content

Hello again...

My problem is : how to know the stage's dimentions of a loaded SWF to center
it correctly in its container?

Here's my tests on that particular problem

1. Set _lockroot inside the loaded SWF : no effect.
2. Set Stage.scaleMode = |"noScale" : no effect.

|When I execute the loaded SWF independently, the Stage dimentions are
OK but once loaded inside another Flash movie, the Stage's dimentions are
those of the main movie.

I was looking to include a mc with the same dimentions as the stage inside
the loaded SWF but there will be a lot of SWF and not all made by me!

I there a way to retreive this kind of information or is it impossible?

Thanks a million.
___
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


___
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] LoadClip and centering new content

2006-02-03 Thread Nathan Derksen
Not that I know of. If the first frame was representative of the size  
as a whole, then iterating through the movie clips looking for clips  
with negative x/y values could be done, however it's sort of a moot  
point as soon as everything moves around in subsequent frames. I also  
don't think that will work if some of the symbols are graphic symbols  
instead of movie clips. You basically need to know in advance what  
the size of the clip is going to be, then code that into your  
positioning code. Not pretty, but it's doable.


Nathan
http://www.nathanderksen.com


On Feb 3, 2006, at 8:40 AM, Éric Thibault wrote:


Mmm...

The funiest thing is that if I want to center my loaded SWF that  
has instances outside the loaded SWF'stage, it gets shifted :'(


Is there a way to know the nomber of pixels to the left, top,  
bottom and right of the registration point (0,0) of a container?  I  
could than compensate for the extras of the SWF inside of it...


Say that my container is 200px in width but I know that it has 50px  
extra to the left (-50px), my real width is then 150px??


A+


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


RE: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread Ryan Potter
Eric-

I have run into the same problem before.  the only way I found to force a clip 
to have a certain dimension is to put a graphic in at the size you want the 
clip to be.  I realize that you don't have control over the swfs that are being 
created but I have never been able to solve this either.  The width and height 
of the clip always equate to the width and height of the content in the clip.

The Only way I have been able to solve this is to use onLoadInit and set vars 
on the child that state the width and height explicitly.  But this requires 
having access to the fla.

Child Swf in the first frame:
this.w = 300;
this.h = 300;

Parent centering function called from the loader.onLoadInit

function centerClip(clip){
var w = clip.w;
var h = clip.h;
clip._x = Stage.width/2-(w/2);
clip._y = Stage.height/2-(h/2);
}



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Éric Thibault
Sent: Friday, February 03, 2006 9:06 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] LoadClip and centering new content

I already do that... but the width and height of the container clip 
takes into account any instances outside the boundary of the loaded 
SWF's stage...
So I'm getting the total with and height but want only the stage 
dimentions of the loaded SWF!

I want to align the loaded SWF'stage in the loading flash

If it was just for me, i would not put anything outside the stage of the 
loaded SWF but I'm not the producer of those swf...

And having the stage dimentions would help because the loaded SWF's 
dimentions only takes into account the instances present on frame 1... 
(mc_square 100*100 at (0,0) on a stage of 300*300 results in a container 
clip of 100*100!)

A+

j.c.wichman wrote:

>Hi,
>If you use something like:
>   var my_mcl:MovieClipLoader = new MovieClipLoader();
>   
>   var myListener:Object = new Object();
>
>   myListener.onLoadInit = function(target_mc:MovieClip) {
> trace(target_mc._width);
>   }; 
>   my_mcl.addListener(myListener);
>   my_mcl.loadClip(, to container here>_root.dummy);
>
>It should trace the width of your clip upon load. Is that what you mean?
>
>Greetz
>Hans
>
>-Original Message-
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Éric
>Thibault
>Sent: Friday, February 03, 2006 3:11 PM
>To: Flashcoders Mailing List
>Subject: RE:[Flashcoders] LoadClip and centering new content
>
>Hello again...
>
>My problem is : how to know the stage's dimentions of a loaded SWF to center
>it correctly in its container?
>
>Here's my tests on that particular problem
>
>1. Set _lockroot inside the loaded SWF : no effect.
>2. Set Stage.scaleMode = |"noScale" : no effect.
>
>|When I execute the loaded SWF independently, the Stage dimentions are
>OK but once loaded inside another Flash movie, the Stage's dimentions are
>those of the main movie.
>
>I was looking to include a mc with the same dimentions as the stage inside
>the loaded SWF but there will be a lot of SWF and not all made by me!
>
>I there a way to retreive this kind of information or is it impossible?
>
>Thanks a million.
>___
>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


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


Re: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread Éric Thibault

Mmm...

The funiest thing is that if I want to center my loaded SWF that has 
instances outside the loaded SWF'stage, it gets shifted :'(


Is there a way to know the nomber of pixels to the left, top, bottom and 
right of the registration point (0,0) of a container?  I could than 
compensate for the extras of the SWF inside of it...


Say that my container is 200px in width but I know that it has 50px 
extra to the left (-50px), my real width is then 150px??


A+

Nathan Derksen wrote:

Ah yes, that's a fun issue. Unfortunately, once you load an SWF  
inside another, there is no way that I know of to get the original  
published stage size. I would love to be proved wrong, though, but I  
have looked hard for a way to do that as well. All you can really do  
is keep xscale and yscale to 100, and use a fixed size mask so that  
anything outside of the area you have set aside for the clip is  
hidden (in case stuff goes outside the bounds of the stage).


Nathan
http://www.nathanderksen.com


On Feb 3, 2006, at 8:06 AM, Éric Thibault wrote:

I already do that... but the width and height of the container clip  
takes into account any instances outside the boundary of the loaded  
SWF's stage...
So I'm getting the total with and height but want only the stage  
dimentions of the loaded SWF!


I want to align the loaded SWF'stage in the loading flash

If it was just for me, i would not put anything outside the stage  of 
the loaded SWF but I'm not the producer of those swf...


And having the stage dimentions would help because the loaded SWF's  
dimentions only takes into account the instances present on frame  
1... (mc_square 100*100 at (0,0) on a stage of 300*300 results in a  
container clip of 100*100!)


A+

j.c.wichman wrote:


Hi,
If you use something like:
var my_mcl:MovieClipLoader = new MovieClipLoader();
   
var myListener:Object = new Object();


myListener.onLoadInit = function(target_mc:MovieClip) {
  trace(target_mc._width);
}; my_mcl.addListener(myListener);
my_mcl.loadClip(, _root.dummy);

It should trace the width of your clip upon load. Is that what you  
mean?


Greetz
Hans

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Éric
Thibault
Sent: Friday, February 03, 2006 3:11 PM
To: Flashcoders Mailing List
Subject: RE:[Flashcoders] LoadClip and centering new content

Hello again...

My problem is : how to know the stage's dimentions of a loaded SWF  
to center

it correctly in its container?

Here's my tests on that particular problem

1. Set _lockroot inside the loaded SWF : no effect.
2. Set Stage.scaleMode = |"noScale" : no effect.

|When I execute the loaded SWF independently, the Stage dimentions  are
OK but once loaded inside another Flash movie, the Stage's  
dimentions are

those of the main movie.

I was looking to include a mc with the same dimentions as the  stage 
inside

the loaded SWF but there will be a lot of SWF and not all made by me!

I there a way to retreive this kind of information or is it  
impossible?


Thanks a million.
___
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



___
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] LoadClip and centering new content

2006-02-03 Thread Helen Triolo
Looks like that info is in the swf header (Northcode pulls from that to 
do its getStageSize) but I don't know how you can access the header of a 
loaded swf from within Flash itself.


Helen

Éric Thibault wrote:

I already do that... but the width and height of the container clip 
takes into account any instances outside the boundary of the loaded 
SWF's stage...
So I'm getting the total with and height but want only the stage 
dimentions of the loaded SWF!


I want to align the loaded SWF'stage in the loading flash

If it was just for me, i would not put anything outside the stage of 
the loaded SWF but I'm not the producer of those swf...


And having the stage dimentions would help because the loaded SWF's 
dimentions only takes into account the instances present on frame 1... 
(mc_square 100*100 at (0,0) on a stage of 300*300 results in a 
container clip of 100*100!)


A+

j.c.wichman wrote:


Hi,
If you use something like:
var my_mcl:MovieClipLoader = new MovieClipLoader();
   
var myListener:Object = new Object();


myListener.onLoadInit = function(target_mc:MovieClip) {
  trace(target_mc._width);
}; my_mcl.addListener(myListener);
my_mcl.loadClip(, _root.dummy);

It should trace the width of your clip upon load. Is that what you mean?

Greetz
Hans





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


Re: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread Nathan Derksen
Ah yes, that's a fun issue. Unfortunately, once you load an SWF  
inside another, there is no way that I know of to get the original  
published stage size. I would love to be proved wrong, though, but I  
have looked hard for a way to do that as well. All you can really do  
is keep xscale and yscale to 100, and use a fixed size mask so that  
anything outside of the area you have set aside for the clip is  
hidden (in case stuff goes outside the bounds of the stage).


Nathan
http://www.nathanderksen.com


On Feb 3, 2006, at 8:06 AM, Éric Thibault wrote:

I already do that... but the width and height of the container clip  
takes into account any instances outside the boundary of the loaded  
SWF's stage...
So I'm getting the total with and height but want only the stage  
dimentions of the loaded SWF!


I want to align the loaded SWF'stage in the loading flash

If it was just for me, i would not put anything outside the stage  
of the loaded SWF but I'm not the producer of those swf...


And having the stage dimentions would help because the loaded SWF's  
dimentions only takes into account the instances present on frame  
1... (mc_square 100*100 at (0,0) on a stage of 300*300 results in a  
container clip of 100*100!)


A+

j.c.wichman wrote:


Hi,
If you use something like:
var my_mcl:MovieClipLoader = new MovieClipLoader();

var myListener:Object = new Object();

myListener.onLoadInit = function(target_mc:MovieClip) {
  trace(target_mc._width);
};  my_mcl.addListener(myListener);
my_mcl.loadClip(, _root.dummy);

It should trace the width of your clip upon load. Is that what you  
mean?


Greetz
Hans

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Éric
Thibault
Sent: Friday, February 03, 2006 3:11 PM
To: Flashcoders Mailing List
Subject: RE:[Flashcoders] LoadClip and centering new content

Hello again...

My problem is : how to know the stage's dimentions of a loaded SWF  
to center

it correctly in its container?

Here's my tests on that particular problem

1. Set _lockroot inside the loaded SWF : no effect.
2. Set Stage.scaleMode = |"noScale" : no effect.

|When I execute the loaded SWF independently, the Stage dimentions  
are
OK but once loaded inside another Flash movie, the Stage's  
dimentions are

those of the main movie.

I was looking to include a mc with the same dimentions as the  
stage inside

the loaded SWF but there will be a lot of SWF and not all made by me!

I there a way to retreive this kind of information or is it  
impossible?


Thanks a million.
___
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



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


Re: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread Éric Thibault
I already do that... but the width and height of the container clip 
takes into account any instances outside the boundary of the loaded 
SWF's stage...
So I'm getting the total with and height but want only the stage 
dimentions of the loaded SWF!


I want to align the loaded SWF'stage in the loading flash

If it was just for me, i would not put anything outside the stage of the 
loaded SWF but I'm not the producer of those swf...


And having the stage dimentions would help because the loaded SWF's 
dimentions only takes into account the instances present on frame 1... 
(mc_square 100*100 at (0,0) on a stage of 300*300 results in a container 
clip of 100*100!)


A+

j.c.wichman wrote:


Hi,
If you use something like:
var my_mcl:MovieClipLoader = new MovieClipLoader();

var myListener:Object = new Object();

myListener.onLoadInit = function(target_mc:MovieClip) {
  trace(target_mc._width);
		}; 
		my_mcl.addListener(myListener);

my_mcl.loadClip(, _root.dummy);

It should trace the width of your clip upon load. Is that what you mean?

Greetz
Hans

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Éric
Thibault
Sent: Friday, February 03, 2006 3:11 PM
To: Flashcoders Mailing List
Subject: RE:[Flashcoders] LoadClip and centering new content

Hello again...

My problem is : how to know the stage's dimentions of a loaded SWF to center
it correctly in its container?

Here's my tests on that particular problem

1. Set _lockroot inside the loaded SWF : no effect.
2. Set Stage.scaleMode = |"noScale" : no effect.

|When I execute the loaded SWF independently, the Stage dimentions are
OK but once loaded inside another Flash movie, the Stage's dimentions are
those of the main movie.

I was looking to include a mc with the same dimentions as the stage inside
the loaded SWF but there will be a lot of SWF and not all made by me!

I there a way to retreive this kind of information or is it impossible?

Thanks a million.
___
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


RE: [Flashcoders] LoadClip and centering new content

2006-02-03 Thread j.c.wichman
Hi,
If you use something like:
var my_mcl:MovieClipLoader = new MovieClipLoader();

var myListener:Object = new Object();

myListener.onLoadInit = function(target_mc:MovieClip) {
  trace(target_mc._width);
}; 
my_mcl.addListener(myListener);
my_mcl.loadClip(, _root.dummy);

It should trace the width of your clip upon load. Is that what you mean?

Greetz
Hans

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Éric
Thibault
Sent: Friday, February 03, 2006 3:11 PM
To: Flashcoders Mailing List
Subject: RE:[Flashcoders] LoadClip and centering new content

Hello again...

My problem is : how to know the stage's dimentions of a loaded SWF to center
it correctly in its container?

Here's my tests on that particular problem

1. Set _lockroot inside the loaded SWF : no effect.
2. Set Stage.scaleMode = |"noScale" : no effect.

|When I execute the loaded SWF independently, the Stage dimentions are
OK but once loaded inside another Flash movie, the Stage's dimentions are
those of the main movie.

I was looking to include a mc with the same dimentions as the stage inside
the loaded SWF but there will be a lot of SWF and not all made by me!

I there a way to retreive this kind of information or is it impossible?

Thanks a million.
___
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] LoadClip and centering new content

2006-02-03 Thread Éric Thibault

Hello again...

My problem is : how to know the stage's dimentions of a loaded SWF to 
center it correctly in its container?


Here's my tests on that particular problem

1. Set _lockroot inside the loaded SWF : no effect.
2. Set Stage.scaleMode = |"noScale" : no effect.

|When I execute the loaded SWF independently, the Stage dimentions are 
OK but once loaded inside another Flash movie, the Stage's dimentions 
are those of the main movie.


I was looking to include a mc with the same dimentions as the stage 
inside the loaded SWF but there will be a lot of SWF and not all made by me!


I there a way to retreive this kind of information or is it impossible?

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


Re: [Flashcoders] LoadClip and centering new content

2006-02-02 Thread Éric Thibault

OUF!!!  long day... full of typo mistakes... sorry!

Éric Thibault wrote:


Hi all!!!

I've finaly made my component but can accross the issue of aligning 
the newly loaded content...


I can align correctly images but swf is a bit complicated...

1. If I load a SWF that the stage is 300*300 but on frame 1 there is 
only 1 MC of 100*100, the with of the newly loaded SWF is 100*100 like 
it does'nt take into account the stage dimensions!


2. If I load the same SWF but with content outside its stage borders 
(-100,-100),   the dimention are now 200*200


How can I center it now?!?!?!?

Is there a way to know once loaded the stage dimentions of the newly 
loaded SWF... (even the _lockroot does not function)


There will be SWF files that will be produced by third parties!

Thanks a million.




--
===

Éric Thibault
Programmeur analyste
Réseau de valorisation de l'enseignement
Université Laval, pavillon Félix-Antoine Savard
Québec, Canada
Tel.: 656-2131 poste 18015
Courriel : [EMAIL PROTECTED]

===

Avis relatif à la confidentialité / Notice of Confidentiality / Advertencia de 
confidencialidad 

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


[Flashcoders] LoadClip and centering new content

2006-02-02 Thread Éric Thibault

Hi all!!!

I've finaly made my component but can accross the issue of aligning the 
newly loaded content...


I can align correctly images but swf is a bit complicated...

1. If I load a SWF that the stage is 300*300 but on frame 1 there is 
only 1 MC of 100*100, the with of the newly loaded SWF is 100*100 like 
it does'nt take into account the stage dimensions!


2. If I load the same SWF but with content outside its stage borders 
(-100,-100),   the dimention are now 200*200


How can I center it now?!?!?!?

Is there a way to know once loaded the stage dimentions of the newly 
loaded SWF... (even the _lockroot does not function)


There will be SWF files that will be produced by third parties!

Thanks a million.

--
===

Éric Thibault
Programmeur analyste
Réseau de valorisation de l'enseignement
Université Laval, pavillon Félix-Antoine Savard
Québec, Canada
Tel.: 656-2131 poste 18015
Courriel : [EMAIL PROTECTED]

===

Avis relatif à la confidentialité / Notice of Confidentiality / Advertencia de 
confidencialidad 

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