Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to convert a Flash SWF to EXE? Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
14-Apr-04
Category
Multimedia
Language
Delphi 2.x
Views
158
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Lou Adler

How to convert a Flash SWF to EXE?

Answer:

1   function Swf2Exe(S, D, F: string): string;
2   //S = Source file (swf)
3   //D = Destionation file (exe)
4   //F = Flash Player
5   var
6     SourceStream, DestinyStream, LinkStream: TFileStream;
7     flag: Cardinal;
8     SwfFileSize: Integer;
9   begin
10    Result := 'something error';
11    DestinyStream := TFileStream.Create(D, fmCreate);
12    try
13      LinkStream := TFileStream.Create(F, fmOpenRead or fmShareExclusive);
14      try
15        DestinyStream.CopyFrom(LinkStream, 0);
16      finally
17        LinkStream.Free;
18      end;
19  
20      SourceStream := TFileStream.Create(S, fmOpenRead or fmShareExclusive);
21      try
22        DestinyStream.CopyFrom(SourceStream, 0);
23        flag := $FA123456;
24        DestinyStream.WriteBuffer(flag, SizeOf(Integer));
25        SwfFileSize := SourceStream.Size;
26        DestinyStream.WriteBuffer(SwfFileSize, SizeOf(Integer));
27        Result := '';
28      finally
29        SourceStream.Free;
30      end;
31    finally
32      DestinyStream.Free;
33    end;
34  end;
35  
36  procedure TForm1.Button1Click(Sender: TObject);
37  begin
38    Swf2Exe('c:\somefile.swf', 'c:\somefile.exe',
39      'c:\Program Files\Macromedia\Flash MX\Players\SAFlashPlayer.exe');
40  end;



			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC