Welcome to WebmasterWorld Guest from 54.158.143.40

Forum Moderators: open

Message Too Old, No Replies

How to get .swf file's Height and Width

   
7:48 am on Jul 31, 2005 (gmt 0)

5+ Year Member



How to get .swf file's Height and Width in C# or VB.net Program.Because I want to Load dynamicly a .swf file in my program with Flash File current size.
9:29 am on Aug 1, 2005 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld, ydmyongan!

The width and height of a flash object are set in the (x)HTML code. These can be accessed using JavaScript:


flashObject = document.getElementById('flashObjectID');
flashWidth = flashObject.width;
flashHeight = flashObject.height;

You need to do this at the client side, rather than at the server side, as there is no real access to the DOM from the server side.

HTH

9:01 pm on Aug 1, 2005 (gmt 0)



yep but he's referring to accessing flash in a c+ programme not via a browser or XHTML
10:23 am on Aug 2, 2005 (gmt 0)

WebmasterWorld Senior Member blobfisk is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Yep, I realise that. And unfortunately to the best of my knowledge there is no way of doing this. The flash object does not get a width or a height until the browser rendering engine assignes it when the page is being renderered.

Even if a flash developer gives the move canvas certain dimensions, that does not mean that those will be the sizes that the movie is rendered at.

4:01 pm on Aug 3, 2005 (gmt 0)

10+ Year Member



Hi -
Open it in the Flash Player and use something
like MW Snap to get a screenshot of the window.
Crop out the menu, etc. and the resulting dimensions
of that image should be close enough for you to use.

Newbie Suggtn.,
El