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(<YOUR path to SWF here eg "test.swf">, <path
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


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

Reply via email to