Is it possible to compile a FLA using mxmlc? - actionscript-3

Let me give you a little explanation of what I'm trying to do first. I'm working on a new AS3 based architecture and I'm trying to fix some issues I had in the past with AS2. Each screen has its own FLA, and multiple screens reference certain components; a Button for example. The problem occurs when something in Button changes. Every single screen that uses Button has to be republished or else it has a chance that it won't pick up the change due to how Flash class definitions work: The first Button definition that loads at runtime is the one that everything uses. So if a screen using the old Button loads first then everything will be using the old definition and things will break. It can take an hour or more to figure out which FLA needs to be exported to fix it since there are so many and the connection between them isn't always obvious. So as you can see, this is a major time sink that needs to be fixed.
I've learned that in AS2 you can use an exclude.xml file to exclude class definitions from the SWF when the FLA is published. In this way, I figured out an architecture I can set up where there is a Shell SWF that is the only place where the Button class is defined. Shell then loads in all of the other screens that all have Button excluded so that they only pick up the Shell version. This makes sure that if anything in Button changes, the only thing that needs to be republished is the Shell and then everything else picks up the change at runtime.
This is all well and good, except that when using AS3 the exclude.xml file no longer works. Because of this I've turned to MXMLC, which can mimic the exclude.xml functionality by using the -link-report compiler option to build the exclude.xml when compiling the Shell SWF, and then pass that XML to -load-externs on every other screen to exclude everything that is built by the Shell. The only way I've found to do this is by publishing everything as a SWC from Flash and then using -include-libraries to build the SWF from the SWC along with the -load-externs to exclude everything I don't want to be there. This does the trick just fine, except that publishing as a SWC does not include anything defined on the timeline or, more specifically, the stage. A lot of design work is done on the timeline in Flash by layering on the different parts and dropping in named MovieClips all over the place that are then referenced in ActionScript, but the SWC doesn't pick up any of this information as far as I can tell.
So now we come to my question. Is there some way to compile all of the information in a FLA using MXMLC so that I can exclude everything while still being able to design out everything on the timeline/stage?

I sent an email to Grant Skinner and he basically said the only way he knew of to do excludes with AS3 was with RSL or SWC. He wasn't entirely sure which method worked since it had been a long time, so I don't have a definitive answer. I spent a while trying to figure it out using SWCs, but I didn't really get any decent results from it so I'm giving up for now.
The important part to note is that it is indeed impossible to run MXMLC to build a FLA. Or at least if it is possible, it requires very complex knowledge that not many people know.

Related

How to create a new swf on the server from a moviclip in current swf

I have a movieClip on the stage with a loaded swf playing animation and sound. I want to export the movieclip to swf. I thought I would be able to do something similar to the jpeg export?.
The main swf and the one being loaded in to be copied are on the same server.
I've searched about but I have not come across anything that outlines what needs to be done.
Any chance of a bit more in-depth explanation as to how to accomplish this?
I did have one post on here already about where someone had a similar question but the moders felt a need to delete it :(
There's a library called Ming which might suit your needs.
Also, as serverside swf generation is not trivial, do you really need it? If you need a dynamic swf, you could also create a template and create the content using flashvars in combination with a serverside language like PHP.

Render between two lines of code

I have a huge code execution with many loops and pre-rendering processes and I was wondering if there is a way to tell the flash player to take a little pause on the code side and do a render.
Basically I have my execusion that takes a while, and on each step I make a call to a screen and then modify the scale of a loading bar. Now the problem is that the user only sees the progress at the end, I know this is due to the fact that flash does code execution and then render, i tried to make calls to stage.invalidate to force a render but it wouldnt work until the whole execusion if finished either. Is there a way to force flash to render between two lines of code?
I encountered a similar problem in which my AS code would be running for a long time and the UI was getting unresponsive. So I implemented my logic as a Green Thread.
Check out this link for an as3 implementation and examples.
UIComponent has a rendering "framework" built into it. All display objects extend from it.
This will allow you to optimize your code, by using the invalidate methods.
You will want to familiarize yourself with pseudo-threads.

Flash .exe projector on a cd, memory issues

I'm working with a project where we are running a projector from/on a CD, and this can't be changed, to run an e-learning program of sorts. Everything is included on the CD and it doesn't need anything else to run, ie all imgs and xml and whatnot is on the CD.
The problem is that on some computers, assumedly less powerful ones, the entire process clogs up and instead of showing the images just white blank areas appear. The imgs used have been downgraded to a lower resolution, from 1333x1000 to 800x600, and this has solved the problem from what we've found so far.
My question is, does anyone know of any other way to solve this without cutting down the img quality?
As it is right now all the pics (about 180 i think) are being loaded right when the process starts and one idea i have is that you load the pics gradually as needed, 2-3 in advance back and forward or maybe an entire chapter even (7 chapters with imgs are used), to always ensure smooth tweens without having to wait for loading.
But as I've read that there seems to be some memory issue when using a flash projector on a CD/DVD, I'd also like to get more details on what the actual problem is and if possible to find more solutions to it.
I found some links that were supposed to target Adobes own views on the problem, but these links were obsolete. (links found here http://www.flashjester.com/?section=faq&cPath=14_23#394).
Any ideas, help, links, tutorials and what not are welcome.
Yeah, you need to load your assets on-demand and be careful about references so unused things are really garbage collected when they aren't needed anymore.
If you are really running from a projector, then load times aren't totally a concern. Assets form the local filesystem are always available the next frame; they aren't streamed from the disk like from the network. However, bigs file or ones with lots of exports may end up with a longer frame time, or a noticeable delay.
You also need profile things to see if your changes are actually doing anything. Poke through the flash.system.System class to see how you can get info, or take a look at SWFProfiler.

Actionscript guru puzzle

Can someone suggest a workaround to the following problem:
I want to make an application that will create an area on stage that will be filled with images. Firstly, the images have to be 'saved' on an array. The problem for me is that I want this to be quite generic. I mean, according to a configuration file(?) or some constants(?), one build of the application may result to an SWF that will create a Rectangle area on stage filled with some graphics from virtual folder 1, while another build of the same application may result to one rectangle area and one triangle area each one filled with graphics from virtual folder 1, and folder 2 respectively.
I have stuck here sometime now. Can you suggest a workaround to this?
I'm not sure I completely understand your question, but I've been creating a somewhat similar application in AS3 which reads from a text-file using a URLLoader, and then parses that text to figure out which images to display on screen. It's quite easy to do basic parsing using the built in String library methods. Would this technique work for your problem?

AS3 - can't interact with swf file after loaded in

So I have this interactive swf file that I loaded externally as a background, everything's fine, but it's just not interactive anymore, I can't click on it. I googled this problem for a really long time and couldn't find an answer, I've tried the normal Flash way, and also using this library CASAlib, still couldnt find a solution. Does anyone know how to make this work? Thanks.
Cheers,
Christine
May be the objects on the foreground are preventing the background SWF from getting any mouse actions. It's hard to say anything without seeing the code.
What is the ActionScript version of loader and loaded content? If it's 2 and 3 it will hapen as you say. If all is set to as3 it will work. Remeber about sandbox restrictions.