a friend made me a very nice flash for a program, but it weighs 3 mega
is it possible to do lighter (1 mega max)?
compress flash
- Joakim Christiansen
- Addict

- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
Re: compress flash
Is it used within a PB program?effis wrote:a friend made me a very nice flash for a program, but it weighs 3 mega
is it possible to do lighter (1 mega max)?
If so you could include the compressed file and then decompress it at runtime.
(check out "Packer" in the help file)
Last edited by Joakim Christiansen on Sun Jan 30, 2011 4:50 pm, edited 1 time in total.
I like logic, hence I dislike humans but love computers.
- Joakim Christiansen
- Addict

- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
Re: compress flash
Well, with PureBasics weird functions for handling compression the quickest solution I came up with is something like this:effis wrote:hummm... how?
Code: Select all
;run this once then comment it away
If CreatePack("compressedFlashfile.pak")
AddPackFile("yourFlashfile.swf")
ClosePack()
EndIf
;-----------------
;include file inside your program (when compiling)
DataSection
compressedFlashfile:
IncludeBinary "compressedFlashfile.pak"
endOfData:
EndDataSection
;extract the file at runtime
file = CreateFile(#PB_Any,"compressedFlashfile.pak")
If file
WriteData(file,?compressedFlashfile,endOfData-compressedFlashfile)
CloseFile(file)
EndIf
;extract the flash file to memory
If OpenPack("compressedFlashfile.pak")
*memPointer = NextPackFile()
memSize = PackFileSize()
ClosePack()
;write the decompressed content to a file
file = CreateFile(#PB_Any,"extractedFlashfile.swf")
If file
WriteData(file,*memPointer,memSize)
CloseFile(file)
EndIf
EndIf
;extractedFlashfile.swf is now the file you can use in your programI like logic, hence I dislike humans but love computers.
- codewalker
- Enthusiast

- Posts: 331
- Joined: Mon Mar 27, 2006 2:08 pm
- Location: Spain
Re: compress flash
Import your swf into the program sothink swf quicker and use it's compiler.
It has a high compression rate. Then use a swf compressor such as eltima.
cw
It has a high compression rate. Then use a swf compressor such as eltima.
cw
There is a difference between knowing the code and writing the code.
May the code be strong in your projects.
May the code be strong in your projects.
Re: compress flash
thanks
but when i'm commpressing its still 3 mega
i'll speak with him that he will do it
but when i'm commpressing its still 3 mega
i'll speak with him that he will do it
