View Full Version : [Q] How to parse SWF header with ASP???
CyanBlue
12-19-2005, 05:50 PM
Howdy... :)
A quick question...
Does anybody know how to parse the SWF header to get the version/width/height of it by using the ASP???
This link came in the radar of the Google, but it does not work properly...
http://www.4guysfromrolla.com/webtech/tips/t102001-1.shtml
Any help would be appreciated...
Thanks... :)
I was able to get that code work. You just have to hard code the swf name and change the map path if you test it locally..but it works for me.
CyanBlue
12-19-2005, 07:59 PM
Hm... I have attached the sample file...
If I call the ASP page via http://localhost/ASP_Header/getswfinfo.asp?swf=test/banner.swf , I get to see the following data...
c:\inetpub\wwwroot\ASP_Header\test\banner.swf
c:\inetpub\wwwroot\ASP_Header\test\banner.swf
test/banner.swf
Height (pixel) = 504.55
Width (pixel) = 1178.4
Version = 6
FileLen (bytes) = 83462
xMin (twips) = 2507
xMax (twips) = 26075
yMin (twips) = 5456
yMax (twips) = 15547
FrameRate = 46
FrameCount = 47324
But the actual dimension of that SWF file is 728x90... and the frame rate is 18... (Don't have the FLA file for it...)
I noticed it returns the wrong height and width....I think its a twip to pixels conversion error...It keeps telling me my swf is 29px high, when its really 300px...The frame rate is also way off..I didnt look at the include file all that much, maybe I should and see if its a math error, then again, I'm horrible at math.
CyanBlue
12-19-2005, 08:12 PM
Math... Yikes... :D
Yeah I suck at math...the problem has to be where its grabbing the min and max for x and y...width was always off about 70px and height was always off by about 350px...which is a huge miss..I'll toy with code later tonight and see if I cant maybe, "fix" it...
CyanBlue
12-19-2005, 08:58 PM
Thanks, Cota... Appreciate it... ;)
The other problematic area is the conversion from twips to pixels..apparently its a big debate...does 20 twips make 1 pixel, or does 15 twips make 1 pixel...well we know for sure that 1440 twips makes 1 inch, but only at certain resolutions...my head hurts now...
Strange, now it wont even run for me, it just hangs...wonder what I broke..
so much to ASP
use PHP :D
CyanBlue
01-13-2006, 12:59 AM
Dang... Why am I working at the M$ shop??? :( :D
Its really odd, it was working when we first started testing it, now it just hangs...and nothing has changed.
CyanBlue
01-14-2006, 08:53 PM
Ah... Power of M$... :D Yeah... That's very odd... :(
I will figure this mess out...but I have a question...did the Flash SWF format change from Flash5 to MX and above...thats the only thing I can come up with for why the sizes are off..
Flash Gordon
01-14-2006, 11:20 PM
Maybe this can give you guys an idea what is wrong. Good luck!
PHP:
http://www.sephiroth.it/swfreader.php
But the ASP script I think is running into a Flash player version issue...thats my educated guess....
CyanBlue
01-16-2006, 03:21 PM
Yeah, I know how to do that in PHP... ASP is the problem, Flash Gordon... :(
I don't think the SWF format has changed... Maybe I am wrong... I'll browse through and see if I can get more information on that... Thanks, Cota... :)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.