Solved

Flex Architecture question - combing projects

Posted on 2011-03-18
7
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 29

Accepted Solution

by:
dgofman earned 500 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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
disable the module by showing a transparent layer showing a message 4 348
Flash AS3 & random animation 7 856
flex spark videoPlayer: how to get total time ? 3 604
rebuild swf 5 483
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…
The world seems to conceive of a curious bubble separating IT from “the business.”  More so than just about any other pursuit in the commercial world, people think of IT as some kind of an island.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

726 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