Mr. Boy
Mr. Boy

Reputation: 63816

How big should a Flex SWF be?

I've a fairly small Flex4 project targeting Flash 10, developed in FlashDevelop. I know Flex SWFs carry extra overheads to a plain AS3 project, but 240Kb for release build seems still a lot - is it? Or is this a realistic minimum?

In case it's relevant, FlashDevelop builds my project with the following (anonymized):

mxmlc -load-config+=obj\********.xml -incremental=true -benchmark=false -optimize=true -static-link-runtime-shared-libraries=true -o obj\*****************

Doesn't Flash player include Flex runtimes or something sensible like that?

Upvotes: 1

Views: 210

Answers (2)

mgPePe
mgPePe

Reputation: 5907

240KB is not a lot. Yet.

However, in my opinion, Flex does make files quite large when you start developing bigger applications, which is the reason I do plain ActionScript projects.

Flash Player does not come with preloaded framework data in. Therefore, 1) do what sam said with Runtime libraries. 2) load almost all files after the main flash has loaded, thus giving the user meaningful info, while the rest loads (you could load homepage, display it, and only then start loading the other sections). You could use something nice called BulkLoader.

hth

Upvotes: 1

Samuel Neff
Samuel Neff

Reputation: 74949

The player does not include the Flex framework. It shouldn't. The Flex framework is independent of the player and if it was included the player would have to include every version of the framework to use the one each swf was built against. To solve this the framework is different (as is the Flash framework).

The resolution to large swfs is to use Framework Runtime Shared Libraries. This way the player will load a shared library swf once for the specific framework version you used and this shared library will be used across all swfs that were compiled against the same framework version.

You can find more information here:

http://livedocs.adobe.com/flex/3/html/help.html?content=rsl_09.html

In practice, it's somewhat like having the framework in the player, but it's just not pre-loaded. The frameworks get loaded as needed.

Upvotes: 2

Related Questions