Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Flex Architecture question - combing projects

Posted on 2011-03-18
7
Medium Priority
?
265 Views
Last Modified: 2012-06-27
I have an application which is really a site which contains two frames - nav and body.

The body contains logic to display different files, each with it's own .swf file.

Each .swf file generally has a single .mxml file creating the presentation layer, with optional class/components, etc.

I'm considering consolidating, but not sure if I should/or the best way. Right now it's simple: show this .swf or that .swf, etc. If I convert to a single .swf...what's the easiest way to "show this .mxml source or that source, etc."
0
Comment
Question by:coldchillin
  • 4
  • 3
7 Comments
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 total points
ID: 35168902
Right now it's simple: show this .swf or that .swf, etc. If I convert to a single .swf...what's the easiest way to "show this .mxml source or that source, etc." ???

"View Source" available per Application.

If you want create two SWF files you can create one Application and attach two ModuleLoader (s)
Now change mx:Appliaction to mx:Module in both files, and you will able to share View Source for both.
0
 
LVL 1

Author Comment

by:coldchillin
ID: 35244571
dgofman,

If we understand each other correctly, my site is broken into about 20 projects. Upgrades to the IDE require that each project be imported and reconfigured, and changes require compilations to individual projects.

What I'd like to do is consolidate everything into a simple compilation, and single .swf file.

Does the module loader load a .mxml file, or a .swf?
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35244625
Yes, that is nice style to use Module(s).
You will reduce downloading time for your client as well as caching SWF on the client side.
For example you have 20 projects if you will compile into 1 SWF you will get around 2-10 MB file.
If you will modify in project A MXML file your clients should download again 2-10 MB file. If you will use ModuleLoader you will compile 20 SWF and one SWF wrapper class. In this case if you will modify project A you just need to provide to your client URL to A.swf file.

To handle replacing old A,swf by new A.swf you mey need to implement a timestap or version id.

Example:

A.swf?v=1

you modify A.mxml update your HTML file by calling

A.swf?v=2
0
Enhanced Intelligibility Without Cable Clutter

Challenge: The ESA office in Brussels wanted a reliable audio conference system for video conferences. Their requirement - No participant must be left out from the conference and the audio quality must not be compromised.

 
LVL 1

Author Comment

by:coldchillin
ID: 35343361
Doesn't each project require 1 application file?

Let's say I have 4 Projects

Project Wrapper
Project Navigation
Project Home
Project About

Project Wrapper will be a single .mxml file with Application tags. Within those tags I will have a ModuleLoader. One will load Navigation.swf, and the other will load either Home.swf or About.swf

--Wrapper.mxml

<mx:Application...

<mx:ModuleLoader id="modLoader"  url="Navigation.swf?v=1.0"  
preinitialize="modLoader.applicationDomain=ApplicationDomain.currentDomain"/>

<mx:ModuleLoader id="modLoader"  url="Home.swf?v=1.01"
  preinitialize="modLoader.applicationDomain=ApplicationDomain.currentDomain"/>
</mx:Application>

For Projects Navigation, Home, and About, I will have a single .mxml file that opens with mx:Module tags, or mx:Application tags?
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35348580
I cannot understand why you have any problems?

Ok here is example

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" viewSourceURL="srcview/index.html">
	<mx:ModuleLoader id="modLoader1"  url="Navigation.swf?v=1.0" />
	<mx:ModuleLoader id="modLoader2"  url="Home.swf?v=1.01"/>
</mx:Application>

Open in new window


Navigation.mxml and Home.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300">
</mx:Module>

Open in new window



Now Click on menu Project->Export Release Build...
Click on check box "Enable view source"
And button Finish

Execute you project, right click and you will able to see Application and two modules in the same HTML file
0
 
LVL 1

Author Comment

by:coldchillin
ID: 35351683
I have two projects here: Wrapper and Main.

The Wrapper.mxml looks like this:

<s:Application...>
        <mx:ModuleLoader id="modNav" url="apps/nav.swf?v=1" width="100%" height="80" />      
      <mx:Label id="out" text="Hey there" />
      <mx:ModuleLoader id="modMain" url="apps/nav.swf?v=1" width="100%" height="100%" />
</s:Application>

But the output stacks everything on top of each other instead of one after the other?!?!
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35351718
You have to check on line tutorials migration Flex 3 to Flex 4.
The big difference between 3 & 4 you have to add layout tags.

<s:layout>
    <s:VerticalLayout/>
</s:layout>
0

Featured Post

Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question