homepage Welcome to WebmasterWorld Guest from 54.197.110.151
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
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
ydmyongan

5+ Year Member



 
Msg#: 588 posted 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.

 

BlobFisk

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



 
Msg#: 588 posted 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.

HTH

Richard_N



 
Msg#: 588 posted 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

BlobFisk

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



 
Msg#: 588 posted 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.

eljaykay

5+ Year Member



 
Msg#: 588 posted 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.,
El

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