compiling and only one exe file

Hi all

I have a swf flash file embedded in vb application (vb 6.0)
now it is running but there are two files swf and vb application

When i compile it, i need only one exe file, that is vb application and swf file is compiled together (only one exe file)

I tried to use VB Recouse Editor, but i couldnt use it

How can i compile them together

thanks in advance

LVL 13
Who is Participating?
vinnyd79Connect With a Mentor Commented:
You cannot do that. You will have to extract the swf file from the exe to a temp file while your app runs,then kill the file when your app closes. Here is an example:

Private Sub Form_Load()
Dim swfFile As String
' location to save file to,it will be extracted from .exe
swfFile = Environ("Temp") & "\" & "myfile.swf"

'save Resource item 101 to disk
SaveResItemToDisk 101, "Custom", swfFile

' Load your swfFile
ShockwaveFlash1.Movie = swfFile

End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim swfFile As String
swfFile = Environ("Temp") & "\" & "myfile.swf"

' kill the file when your app unloads
If Dir(swfFile) <> "" Then
    Kill swfFile
End If

End Sub

Private Function SaveResItemToDisk(ByVal iResourceNum As Integer, _
  ByVal sResourceType As String, ByVal sDestFileName As String) As Long
Dim bytResourceData()   As Byte
Dim iFileNumOut         As Integer
On Error GoTo SaveResItemToDisk_err
bytResourceData = LoadResData(iResourceNum, sResourceType)
iFileNumOut = FreeFile
Open sDestFileName For Binary Access Write As #iFileNumOut
Put #iFileNumOut, , bytResourceData
Close #iFileNumOut
SaveResItemToDisk = 0
Exit Function
SaveResItemToDisk = Err.Number
End Function
Why couldn't you use the resource editor? You have to add them as Custom Resources.
nurbekAuthor Commented:
I added to custom Resources

calling like
myFlash.Movie = LoadResData(101, "CUSTOM")

but it doesnt show the swf object
nurbekAuthor Commented:
when i use like this
myFlash.Movie = App.Path & "\test.swf"

it is working
nurbekAuthor Commented:
thank you, it works :)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.