Ted Patrick > { Events & Community } > Adobe Systems


Align Left and UPX Packer with the Flash Standalone Player

I have had to work with the standalone player on several projects requiring cross platform executables with Flash. I am going to cover two problems, align left and player file size.

The standalone player does not support an SALIGN equivalent from within the player itself, so you have to make one yourself using actionscript.

fscommand("showmenu", false)
fscommand("allowscale", false)
onResize = function(){

// 500 is the design size of your SWF at authortime
_level0._x = Math.round(-(Stage.width - 500)/2)

// 400 is the design size of your SWF at authortime
_level0._y = Math.round(-(Stage.height - 400)/2)
}
Stage.addListener(_level0)
stop()

It works great and keeps the (0,0) coordinate at the corner of the Standalone Player window. This works on both Mac and PC flawlessly! ;)

+++++++++++++++++++++++++++++++

Second issue is player size.

I have found this tool immensely useful as it compresses an EXE or DLL.

UPX Packer

Here are some samples:

965 Kb - Flash Standalone Player
483 Kb - UPX Flash Standalone Player

953 Kb - Python 2.3 DLL
336 Kb- Python 2.3 DLL

Both of these examples worked identically before and after compression!

It also looks as though UPX is compatible with Unix so compression of projectors on OSX is potentially supported. Someone try this out on OSX and see if it works. Log your results in the comments.

Less to download!

cheers,

ted ;)

0 Responses to “ Align Left and UPX Packer with the Flash Standalone Player ”

Post a Comment



Jobs


Flex Jobs
city, state, zip


© 2008 Ted On Flash