This content has been marked as final. Show 14 replies
This is a feature of Flex. The smallest Flex file I have made is just under 200k. Try it yourself. What makes it that size is the Flex Framework itself, a must for a Flex example.
If you can do your app in Flash for some 25K, perhaps Flex is not the correct tool for your job.
Try going to your project's properties, Flex Build Path, then Library Path, and set the Framework Linkage to "Runtime shared library (RSL)".
This will greatly reduce the file size. But you will have to deploy the resulting framework files into the same folder as your application. You'll see the two framework files in the bin-release folder. The file names will be something similar to "framework_22.214.171.12410.swf" and "framework_126.96.36.19910.swz".
Search help for "Framework Linkage " to read more details about what this accomplishes.
That will reduce the size of the application's swf BUT will increase the requires down loads to more files with a combined size larger than the original single swf. This is ok IF you plan to deliver many small swf's to the user but is bad for a one-up usage.
Thanks for the info, The RSL thing wont work for me as I will have to store those files on the system, so I have not accomplished anything doing that. My system only has 1 Meg of storage and the web site is already 280k. When I add the OS to that I am at 720k and I still have more system programming to go.
Flash may create a smaller file, but Flex is much quicker and friendlier to work with. Not to mention faster to learn.
What I don't get is how can Adobe make a app like Flash, who's output files size is small doing the same thing, yet Flex output is way greater. Just don't make sense.
ok, i tried this, i created a project and the only thing in there is this:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
When i exported the project the .swf file was 152k, now i think that is INSANE that just a bare bones page with nothing on it would be that large.
Yes. That is what I was saying above.
What you get is the "basic" Flex framework as the starting place for your application. If you do not need the Flex framework, you can use standalone Flash and avoid the framework's overhead. For simple stuff I use a third party swf generator, SWiSHmax. However it is AS2 based instead of Flash CS3 which is AS3 based.
@gsb: Using the runtime shared library only requires the user to download the framework file once. For any subsequent visit it will not be downloaded because it is cached on the user's machine. This is a great feature of Flex and pretty much overcomes the difference in the file size between a similar Flash project. There really is no downside.
@PastaPrimavera: Most Flex developers would disagree with your comment that 152k is 'insane'. I've done full-featured apps in Flex and obtained very reasonable file sizes (using the RSL) of around 350KB. We're talking about RIAs with an entire web site in one file, not HTML pages being loaded one at a time. I'm not sure what kind of "system" you are using which limits you to only 1MB of storage, but I wouldn't be able to do anything with that unless it was a simple brochure website done in HTML. Sounds like you should be questioning your project's scope and choice of tools, not an arbitrary limit imposed on Flex by a 1MB storage limit.
By definition, any RIA website will be larger than what you are demanding. If your target audience does not have broadband and the ability to handle the inherently larger files, don't use Flex. You will only be frustrating yourself for no reason. Wait until you get a project that will let you unleash Flex's potential for creating media-rich web sites. Stick with an HTML editor for now.
Another way of reducing the file size of your application is to use modules.
A monolithic application grows larger and larger as you add features to it.
A modular application remains slim. You add modules to your applications that bring more features and you load them only when needed.
I agree with most of your comments, as far as my choice of tools goes, what I need to do cannot be done with standard HTML code.
I need to create a socket connection to my board to communicate back and forth. I had the the same app I am using not 90% done with FLASH and it was a good 8x smaller file size.
I suppose from a web site developers end 200k is not bad for a site.
however what I am questioning is why is FLASH able to produce such a small size and FLEX is producing such a large size both doing the same thing ?
It is frustrating sometimes!
Flex has a larger file size than Flash because it has much more overhead in its framework. But that framework is what enables us to move way beyond Flash in terms of data manipulation. Flex can easily work with data and application servers with its RPC components. Flash can do this, but it is neither as intuitive or as simple IMO.
Flex code is compatible with code management systems; Flash code is not.
A Flash "application" will not scale like a Flex application will. Working with a timeline is not suited for applications which need to work with lots of different types of changing data. I use After Effects extensively for timeline animation to create Flash video for my Flex applications. but I cannot imagine building a business application within a timeline!
So we pay a bit of a price in file size just to get started using Flex with all its components and features, in comparison to Flash. But I think it is better in scenarios where we work with data and need the ability to scale and expand the manipulation of that data. Flex applications are much easier to debug, modify and expand than Flash apps as they really are full-blown applications.
And don't forget the ability to turn your Flex app into a desktop app using AIR.
Hang in there and pick your development "battles" wisely. Since you obviously have a good grasp on Flash development, you will be able to transfer those skills into Flex and become a killer RIA developer. Don't get frustrated, but try to see the advantages of both worlds and leverage your existing Flash skills into Flex development. Speaking for myself, I wish I had more knowledge of Flash which I could apply to Flex, but Flash has always been rather mysterious to me. So, you have a great advantage here... use it and don't give up on Flex!!!
Thanks, i just got so excited when i started to learn Flash, because it opened up a whole new world for us embedded guys. Think of all the networked stuff you use that could benefit from a nice user interface such as your router, NAS, printer....
I suppose like many new Flash programmers it leaves you rolling your eyes on how to do something. No so intuitive... So when a bud of mine told me about Flex, I tried the demo and GOT INSTANTLY HOOKED!!! I love the crap out of it. The only downfall is that the dam file sizes are so friken large compared to Flash that it limits me on the types of microprocessors I can use due to the internal storage, which has to hold the web page & the system code as well.
I just figured that since I am new to Flex I must have been doing something wrong and importing more than I needed to.
For instance when I define import flash.events.*;
To me ".*" Would mean the whole dam thing, all files for events.
When lets say I was just using a button. Then I would simply just use: import flash.events.button.
I know that is not correct, but I hope it shows my point.
So rather than brining in the whole library using ".*" I could be more specific in what I use from the library.
You're correct about the import statements. Importing just what you need will reduce the file size. Using: import flash.events.MouseEvent is more efficient than: import flash.events.*
Now I understand better what you're trying to do regarding embedding a web page in a hardware device. Never done that. Please share any solutions you come up with!
I sure will share, what I have to figure out is what I am using and to only import those. I have no idea where to start looking for that.
"PastaPrimavera" <email@example.com> wrote in message
> Thanks, i just got so excited when i started to learn Flash, because it
> up a whole new world for us embedded guys. Think of all the networked
> stuff you
> use that could benefit from a nice user interface such as your router,
> I suppose like many new Flash programmers it leaves you rolling your eyes
> how to do something. No so intuitive... So when a bud of mine told me
> Flex, I tried the demo and GOT INSTANTLY HOOKED!!! I love the crap out of
> The only downfall is that the dam file sizes are so friken large compared
> Flash that it limits me on the types of microprocessors I can use due to
> internal storage, which has to hold the web page & the system code as
> I just figured that since I am new to Flex I must have been doing
> wrong and importing more than I needed to.
> For instance when I define import flash.events.*;
> To me ".*" Would mean the whole dam thing, all files for events.
> When lets say I was just using a button. Then I would simply just use:
> I know that is not correct, but I hope it shows my point.
> So rather than brining in the whole library using ".*" I could be more
> specific in what I use from the library.
Everything that is in the same swc with anything you import with it.