02-10-2012 07:26 AM
Could somebody explain or point me to a resource where I can learn about structuring my code with future updates in mind?
More specifically, my app (not yet submitted) includes a piece of music and some graphics that are compiled into the app by placing them in a folder under the src folder (in FlashBuilder). Those required assets bump the size of the bar file up from something like 500k to 3MB, so I'm thinking there must be a way to tell the app to save that stuff somewhere on the user's device, so that next time I want to release additional features, I can just compile the new code and users can download a smaller file that will know where to find the previously installed music and graphics ...
I'm using SharedObject for saving user preferences, but I don't think that's the right place for actual files.
I'm also not sure how the general logistics would work - would I basically submit two bar files to AppWorld, one stand-alone version to be used for new customers and one code-only (or even changed-classes-only ???) version for existing customers?
Solved! Go to Solution.
02-10-2012 08:03 AM
You probably want to save to documents directory: http://help.adobe.com/en_US/FlashPlatform/referenc
To my knowledge there's no way of doing as you propose with multiple BARs. However what you could do is have the SharedObject check for a Boolean flag (installed) - if it doesn't exist, set it and download your assets from your website.
But honestly... in the case you're talking about, 500K to 3MB, this is all pointless and will just be a hassle to maintain. I would only ever bother with this if you're app was reaching the hundreds of MB. An extra 2.5 MB is nothing. If you're really concerned about size, make sure that you're using compressed images - that alone should drop the size down significantly.
02-10-2012 08:05 AM
02-10-2012 09:12 AM
Ah, thank you both for the excellent information (yes, I thought 3Mb might not be worth fretting about - but I always like to learn the professional way of handling things (not having much of a computer science background, I guess I'm always worried about my 'home-cooked' code giving away my lack of experience :-))
Anyway, Peter's point about supporting multiple update paths, of course makes total sense! Good to know the 'download-from-elsewhere' solution outlined by RottenOgre, in case I ever write an app with something huge.