homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

How to get .swf file's Height and Width

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

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)

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.



 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)

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)

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.,

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved