Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-07 Thread Ian Thomas
Juan, (Yeah, it was me on Flash_Tiger... :-) ) To be fair, I'd have suggested that to Andrew a while back, except he said: Thanks Steve. I thought maybe I was onto something with the LoaderInfo classes width and height props that return the nominal w and h, but this information doesn't

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-07 Thread Andrew Sinning
Hi Ian, Some of what I'm seeing is that quite a few of the swfs that I happen to be loading contain their own internal scaling functions. Most typically I'm seeing are swfs that automatically scale to stage.stageWidth and stage.stageHeight. This is for the most part easy to detect, but

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-07 Thread Ian Thomas
Hi Andrew, As far as I remember, the YouTube .swf is a shell around an .flv. So the dimensions of the shell .swf may bear absolutely no resemblance at all to the size of the contained video; and off-hand, I can't think of a way to get at the contained video size. But aren't they all

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-07 Thread Andrew Sinning
Of course, it's a swf around a flv. This makes a bit more sense now. My guess is that the size of the flv _will_ vary, after all there are lots of different video formats. The YouTube shell is going to have its own internal algorithms for computing the scaling of the flv and the placement

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-06 Thread Juan Pablo Califano
PD: I think someone at Flash_Tiger just found a way simpler and more straight forward means to get the stage size: Try loaderInfo.width and loaderInfo.height. http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/LoaderInfo.html Cheers Juan Pablo Califano 2008/10/5, Juan

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-05 Thread Andrew Sinning
Hi Juan Pablo, I just got back to this problem and tested your SwfHeader class. From the few tests that I've run, this returns exactly the same dimensions that the LoaderInfo class does. I'm still stuck. Here's an example of a swf on YouTube: http://www.youtube.com/v/C7PH3GVj104 The

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-05 Thread Juan Pablo Califano
Hi Andrew, I'm not sure were the problem could be, but checking both swf's I got 640x480 and 600x200, which seems right. If I open the swf standalone (I mean double clicking on it), the player opens it with those dimensions. Plus, I've converted the to fla just to check the dimensions and I got

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-03 Thread Andrew Sinning
Thanks Juan. I have a question about the internal class SwfRect that's at the end of the SwfHeader class. I'm really new to AS3, so this will sound like a really dumb question: Where does the internal class SwfRect go? It's outside of the package. Can it be in the same file? Does it need

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-03 Thread Juan Pablo Califano
Actionscript 3.0 allows only one public symbol (class, function, variable or constant) per .as file. I made that class internal so I could put both classes in just one file for this sample, but apart from that, it's not neccesary, really. Cheers Juan Pablo Califano 2008/10/3, Andrew Sinning

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-02 Thread Steve Mathews
No, this is not easy. Unfortunately the data that defines the stage size is not directly available in AS code. I believe it is only in the swf file's header, so you would actually have to do a lot of work to figure out what size the swf should be masked at. Steve On Thu, Oct 2, 2008 at 7:36 AM,

RE: [Flashcoders] sizing an arbitrary loaded swf

2008-10-02 Thread Steve Abaffy
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Mathews Sent: Thursday, October 02, 2008 10:39 AM To: Flash Coders List Subject: Re: [Flashcoders] sizing an arbitrary loaded swf No, this is not easy. Unfortunately the data that defines the stage size is not directly

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-02 Thread kris range
PROTECTED] On Behalf Of Steve Mathews Sent: Thursday, October 02, 2008 10:39 AM To: Flash Coders List Subject: Re: [Flashcoders] sizing an arbitrary loaded swf No, this is not easy. Unfortunately the data that defines the stage size is not directly available in AS code. I believe it is only

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-02 Thread Andrew Sinning
Thanks Steve. I thought maybe I was onto something with the LoaderInfo classes width and height props that return the nominal w and h, but this information doesn't seem to jive with what I'm observing. I'm considering using BitmapData class to physically find the visible boarders of loaded

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-02 Thread Andrew Sinning
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Mathews Sent: Thursday, October 02, 2008 10:39 AM To: Flash Coders List Subject: Re: [Flashcoders] sizing an arbitrary loaded swf No, this is not easy. Unfortunately the data that defines the stage size

RE: [Flashcoders] sizing an arbitrary loaded swf

2008-10-02 Thread Kerry Thompson
Andrew Sinning wrote: Andrew, it looks like you sized it a bit too small. Try posting your question in a larger font, and we'll see what we can do to help. Cordially, Kerry Thompson ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] sizing an arbitrary loaded swf

2008-10-02 Thread Juan Pablo Califano
As someone already said, you can grab that data from the swf header. I've done this in C# / .NET and I've just wrote a quick and dirty port of the header parsing part to AS 3.0. Probably there's room for optimization but as a proof of concept I think it's ok. Also, the code could use some