[flexcoders] Re: Interface Over Public/Dispatch

2010-08-05 Thread Stephen
Can applications still listen for events triggered by their modules using this 
method, I am having trouble setting up a listner?

- Stephen

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 Interfaces create a level of abstraction and define a contract.  If properly 
 written they do not have major class dependencies.  You always use then in 
 components published from modules since the loading app can't talk directly 
 to the class otherwise the class gets linked into the main app and the module 
 is worthless.
 
 In other cases, you don't care what class implements the contract so that 
 other folks can supply alternate implementations that don't require the same 
 base classes.
 
 
 On 2/4/10 2:49 AM, criptopus sd_br...@... wrote:
 
 
 
 
 
 
 Why would you choose when making a component to create a interface for the 
 component to pass variables to and from it over using say public variables to 
 send data to the component and dispatch and listen events to return data back?
 
 I have been using the Lynda.com tutorials and they use public/dispatch and I 
 noticed from the MobileTitleWindow you could use a class interface with get 
 and set?
 
 - Stephen
 
 
 
 
 
 
 --
 Alex Harui
 Flex SDK Team
 Adobe System, Inc.
 http://blogs.adobe.com/aharui





[flexcoders] Educate me on how to build an application

2010-08-05 Thread Wally Kolcz
I've been developing Flex apps for a while now and never had a problem 
with Flex 3, then when Flex 4 came out I started running into all kinds 
of problems with developing an application with modules. Whereas it's 
well documented pertaining problems with loading Modules in Flex 4 
regarding shared resources, it makes me wonder how to build a fast 
loading large Flex app.

I use the Mate Framework and use Events to load data, trigger moves, and 
load other pieces. I do not use the main application to call functions 
or interface with the other modules. They pretty much run indepentent of 
each other, only sharing RemoteObjects. I was under the assumption that 
modules were a good way to break up pieces of an application to keep 
each pieces smaller so they load quickly, but I am finding out that it 
seems it is not the preferred way, so I thought I would ask the experts 
for some education on how to achieve a application that is lightweight 
but full featured.

Here is a break down of my application:

I have a portal online that is shared by 4 different types of users. The 
main application loads basically a login box and a has a block of code 
to load a module based on the user's account type. I  use stock (Module 
Manager) loader ActionScript (see below) that loads one of 2 different 
modules based on if the user is in one group (kids) or a site admin 
(parents, a hospital, or myself for super admin rights) once they log 
in.  Problem is that when the module loads it throws errors regarding 
'One of the parameters is invalid.' and always having to do with the 
Style Manager.

I broke the application down into about a dozen modules since the kid's 
UI is complete different than the other three groups and, in the other 3 
groups, they have access to different types of functionality based on 
their user types. The kids application application has access to about 
10 different types of views (arts  crafts, web cam chat, journal, chat 
rooms, account manager, photo uploading/managing, etc). The admins 
(parents, hospitals, myself) have access to journals, account managers, 
analytics, etc). To keep the size of the application down I created 
modules for each type of sub application and just load them when the 
user wants to use them. I liken it to traditional web when each sub 
application would be another page of the web site and the index page is 
just a link to those pages.

In this scenerio, are modules not the best way to work? What are the 
alternatives to creating 10 sub applications in a main application 
without bloating the size? I know that creating each sub app as a 
component is not the answer for 2 main reasons: Components are shared 
pieces of an application and not full sub apps, and components are 
complied into the application and the size.

So, to make a long question short (too late), what is the best method to 
create an application with lots of 'pages' but not bloat the size of the 
swf? If it is to break each sub application into a module, what is the 
magic bullet that helps load them. I am currently using:

private function loadModule(path:String):void {
 modLoader = ModuleManager.getModule(path);
 modLoader.addEventListener(ModuleEvent.ERROR, 
modErrorHandler);
 modLoader.addEventListener(ModuleEvent.READY, 
modReadyHandler);
 modLoader.load();
 }

 private function modErrorHandler(e:ModuleEvent):void {
 Alert.show(Module did not load correctly, Module 
Loading Error);
 }

 private function modReadyHandler(e:ModuleEvent):void {
 this.removeAllElements();
 this.addElement(modLoader.factory.create() as 
IVisualElement);
 }

I guess my next question, what are the benefits to using ModuleManager 
to load them or using Moduleloader?  Does one work better than the other?

I really want to continue with Flex and want to be a better developer, 
but all these new errors with Flex 4 is very disappointing and SLOWING 
down my development. Thanks!



[flexcoders] Re: Rounding the corners of a scroller

2010-08-05 Thread Brand
Thanks a lot. The site looks amazing! I haven't worked with masks before 
(researching now), but just thinking about playing with the z order of the 
border gives me all kinds of great ideas.

Thanks again!


--- In flexcoders@yahoogroups.com, Jeff Gomes jgo...@... wrote:

 Brand-
 
 I started with the default spark ComboBoxSkin and added a mask and 
 some other tweaks to get it to look the way I wanted, such as moving 
 the border rect to a higher z than the scroller.  It took a bit of 
 trial and error, especially to get it to match up cleanly with the 
 button, which also has a radius.
 
 You can see the result here:  http://www.finselector.com/
 
 -Jeff
 
 At 06:58 8/3/2010, Brand wrote:
 I've got a skin for my comboboxes, and while it's trivial to do 
 rounded corners for the textentry portion, I can't seem to figure 
 out how to round the corners of the dropdown.
 
 If I remove the scroller altogether, the rounded background and 
 border seem to work fine. However, the scroller portion of the 
 dropdown doesn't seem to allow a radius.
 
 I could put the rounded corner into the itemrenderer for the 
 datagroup, but that would make each item have rounded corners, and 
 if the bottom of the dropdown occurs in the middle of an item, I'll 
 still have squared corners on the overall dropdown.
 
 So, does anybody know if there's a way to round off the corners of 
 the scroller object?
 
 Thanks for your time and attention.
 
 ...





Re: [flexcoders] Why does Flex 4 hate modules?

2010-08-05 Thread Wally Kolcz
Thanks for your help Alex, so while parsing though the link report xml I 
SHOULD NOT see any references to the modules? That will help. Also, as 
far as the size issue which was suggest to me before, I started to add 
minHeight and minWidth to all the pieces and it didnt seem to help at all.


On 8/5/2010 1:09 AM, Alex Harui wrote:


Well, you don’t have any references in the code you posted, but it 
could be somewhere else.  Open the link-report, make sure it contains 
a script for the main app’s .mxml file and then see if the string name 
of a module is in the file.  If it is, that’s trouble.  The reason for 
the .mxml file check is that if you are using Flash Builder and module 
projects, the module link-report overwrites the app’s link-report.   I 
generally do this by hand.


Another possibility is that some size calculation is now off for some 
reason and a bad value is being passed in to drawRoundRect.  If you 
can catch the scenario in the debugger you may get more info as to 
what is up.



On 8/4/10 5:10 PM, Wally Kolcz wko...@isavepets.com 
wko...@isavepets.com wrote:







Thank you for your advice. I did that, but I have no idea what i
am looking at. As you can see, I have no references to the modules
from the main application so I still have no idea why its throwing
that error. Where can I find more information on how to read it?

On 8/4/2010 5:16 PM, Alex Harui wrote:




Use a link-report to make sure none of the classes in the
module are being liked into the main app.  Lots of folks have
been doing things like:

Var myModule:MyModule = MyModule(moduleInfo.factory.create()

Instead of using an interface.  This actually links MyModule
into the main app, defeating the purpose of modules, and in
Flex 4, will mess up the style lookup.


On 8/4/10 4:24 AM, Wally Kolcz wko...@isavepets.com
wko...@isavepets.com wrote:








Just kidding..kinda.. After googling a lot of combination
of  terms, I
was able to finally get some answers regarding problems
that seem to
come up while trying to develop a modular application,
but, sadly, I am
not 100% sure what the Adobe person was talking about. The
error always
centers around the mysterious error: 'ArgumentError: Error
#2004: One of
the parameters is invalid. at
flash.display::Graphics/drawRoundRect()...'

More often than not it revolves around a s:Button but I
just got the
same error on a layout that has no buttons. This time it
seems to
revolve this time be a s:BorderContainer since when I
swapped it out
from a s:Group (which worked fine) it started throwing
errors.

My question to the group is how to manage loading Modules
from the
application and not throw errors? Why does this happen
when it never did
it in 3.4. I read it has to do with Style references with
the main
application, but, again, I don't know exactly what that
means or how to
fix it.

Since it seems to come up in the other posts I could find,
I have an
Application that, based on a log in and the user's
'accountType', loads
a modules for that user's portal type. I use this to load
the modules,
which seems to be pretty stock, and it works fine for the
loading and
adding of different modules throughout the application.:

private function loadModule(path:String):void {
 modLoader = ModuleManager.getModule(path);
 modLoader.addEventListener(ModuleEvent.ERROR,
modErrorHandler);
 modLoader.addEventListener(ModuleEvent.READY,
modReadyHandler);
 modLoader.load();
 }

private function modErrorHandler(e:ModuleEvent):void {
 Alert.show(Module did not load correctly, Module
Loading Error);
 }

private function modReadyHandler(e:ModuleEvent):void {
 this.removeAllElements();
 this.addElement(modLoader.factory.create() as
IVisualElement);
 }

Any ideas why I get that error when loading modules? How
can I fix it?
Does ANYONE know why that error is thrown?








--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui http://blogs.adobe.com/aharui





Re: [flexcoders] Why does Flex 4 hate modules?

2010-08-05 Thread Wally Kolcz
After looking at the report I see things like (which makes no sense to me):

script name=_AdminPortal_Styles.as mod=1281021647964 size=16395 
optimizedsize=15325
def id=_AdminPortal_Styles /
pre id=Object /
dep id=mx.skins.spark:TabSkin /
dep id=mx.core:UIComponent /
dep id=spark.skins.spark:FocusSkin /
dep id=mx.skins.spark:ScrollBarTrackSkin /
dep id=mx.core:mx_internal /
dep id=mx.skins.spark:PanelBorderSkin /
dep id=mx.skins.spark:BorderSkin /
dep id=mx.skins.spark:ButtonBarFirstButtonSkin /
dep id=mx.skins.spark:ButtonBarLastButtonSkin /
dep id=mx.styles:CSSCondition /
dep id=mx.utils:ObjectUtil /
dep id=AS3 /
dep id=mx.skins.spark:ScrollBarDownButtonSkin /
dep id=mx.skins.halo:HaloFocusRect /
dep 
id=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Required_1342721164
 
/
dep id=mx.styles:CSSSelector /
dep id=mx.styles:CSSStyleDeclaration /
dep id=mx.skins.spark:DefaultButtonSkin /
dep id=mx.skins.spark:ContainerBorderSkin /
dep id=spark.skins.spark:ErrorSkin /
dep id=mx.skins.halo:BusyCursor /
dep id=mx.core:UITextField /
dep 
id=_AdminPortal_Styles__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_899767333
 
/
dep id=mx.skins.spark:ButtonSkin /
dep id=mx.core:IFlexModuleFactory /
dep id=spark.skins.spark:SkinnableContainerSkin /
dep id=mx.skins.spark:ScrollBarUpButtonSkin /
dep id=mx.skins.spark:ButtonBarMiddleButtonSkin /
dep id=mx.skins.halo:ToolTipBorder /
dep id=mx.skins.spark:ScrollBarThumbSkin /
dep id=mx.styles:IStyleManager2 /
/script

script name=_AdminPortal_FlexInit-generated.as mod=1281021648317 
size=7494 optimizedsize=6782
def id=_AdminPortal_FlexInit /
pre id=Object /
dep id=spark.accessibility:TextBaseAccImpl /
dep id=mx.collections:ArrayList /
dep id=mx.messaging.messages:MessagePerformanceInfo /
dep id=mx.managers.systemClasses:ChildManager /
dep id=mx.messaging.messages:CommandMessage /
dep id=en_US$containers_properties /
dep id=mx.messaging.channels:HTTPChannel /
dep id=mx.core:TextFieldFactory /
dep id=mx.core:mx_internal /
dep id=en_US$components_properties /
dep id=en_US$logging_properties /
dep id=mx.accessibility:UIComponentAccProps /
dep id=mx.messaging.messages:AsyncMessageExt /
dep id=mx.utils:ObjectProxy /
dep id=en_US$layout_properties /
dep id=mx.messaging.messages:AcknowledgeMessageExt /
dep id=AS3 /
dep id=mx.accessibility:AlertAccImpl /
dep id=en_US$messaging_properties /
dep id=en_US$collections_properties /
dep id=mx.styles:StyleManagerImpl /
dep id=mx.messaging.messages:HTTPRequestMessage /
dep id=mx.messaging.messages:AcknowledgeMessage /
dep id=en_US$skins_properties /
dep id=mx.messaging.channels:SecureAMFChannel /
dep id=mx.messaging.config:ServerConfig /
dep id=en_US$core_properties /
dep id=Error /
dep id=en_US$styles_properties /
dep id=mx.core:IFlexModuleFactory /
dep id=mx.collections:ArrayCollection /
dep id=flash.net:registerClassAlias /
dep id=mx.effects:EffectManager /
dep id=flash.net:getClassByAlias /
dep id=en_US$controls_properties /
dep id=en_US$effects_properties /
dep id=mx.accessibility:LabelAccImpl /
dep id=mx.accessibility:TabBarAccImpl /
dep id=mx.messaging.channels:AMFChannel /
dep id=flash.system:Capabilities /
dep id=mx.messaging.config:ConfigMap /
dep id=mx.messaging.channels:SecureHTTPChannel /
dep id=mx.styles:IStyleManager2 /
dep id=mx.messaging.messages:ErrorMessage /
dep id=mx.accessibility:ButtonAccImpl /
dep id=mx.messaging.messages:AsyncMessage /
dep id=mx.accessibility:PanelAccImpl /
dep id=mx.messaging.messages:CommandMessageExt /
/script

script 
name=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Required_1342721164.as
 
mod=1265215554000 size=1096 optimizedsize=385
def 
id=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Required_1342721164
 
/
pre id=mx.core:SpriteAsset /
dep id=AS3 /
/script

script name=_AdminPortal_mx_core_FlexModuleFactory.as 
mod=1281021648317 size=2781 optimizedsize=2042
def id=_AdminPortal_mx_core_FlexModuleFactory /
pre id=mx.core:FlexModuleFactory /
pre id=mx.core:IFlexModuleFactory /
pre id=flashx.textLayout.compose:ISWFContext /
dep id=flash.system:Security /
dep id=AS3 /
dep id=mx.core:IFlexModule /
dep id=flash.system:ApplicationDomain /
dep id=flash.utils:Dictionary /
dep id=mx.preloaders:SparkDownloadProgressBar /
/script

script 
name=_AdminPortal_Styles__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_899767333.as
 
mod=1265215554000 size=1067 optimizedsize=379
def 
id=_AdminPortal_Styles__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_899767333
 
/
pre id=mx.core:SpriteAsset /
dep id=AS3 /
/script

ext id=com.wallykolcz.views.portals:AdminPortal /





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

* To visit your group on the web, go to:

Re: [flexcoders] Why does Flex 4 hate modules?

2010-08-05 Thread Alex Harui
Because I see _AdminPortal_FlexInit and
_AdminPortal_mx_core_FlexModuleFactory, I'm guessing this is the link-report
for the _AdminPortal module, not the main app.

If you just add -link-report to the compiler options, both the main app and
module will output the link-report to the same file, and since modules
compile after apps, the module's link-report overwrites the apps.  You have
to find a way to only tickle an app rebuild or do what I do and just use ANT
or command line.


On 8/5/10 8:33 AM, Wally Kolcz wko...@isavepets.com wrote:

 After looking at the report I see things like (which makes no sense to me):
 
 script name=_AdminPortal_Styles.as mod=1281021647964 size=16395
 optimizedsize=15325
 def id=_AdminPortal_Styles /
 pre id=Object /
 dep id=mx.skins.spark:TabSkin /
 dep id=mx.core:UIComponent /
 dep id=spark.skins.spark:FocusSkin /
 dep id=mx.skins.spark:ScrollBarTrackSkin /
 dep id=mx.core:mx_internal /
 dep id=mx.skins.spark:PanelBorderSkin /
 dep id=mx.skins.spark:BorderSkin /
 dep id=mx.skins.spark:ButtonBarFirstButtonSkin /
 dep id=mx.skins.spark:ButtonBarLastButtonSkin /
 dep id=mx.styles:CSSCondition /
 dep id=mx.utils:ObjectUtil /
 dep id=AS3 /
 dep id=mx.skins.spark:ScrollBarDownButtonSkin /
 dep id=mx.skins.halo:HaloFocusRect /
 dep 
 id=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Required_
 1342721164 
 /
 dep id=mx.styles:CSSSelector /
 dep id=mx.styles:CSSStyleDeclaration /
 dep id=mx.skins.spark:DefaultButtonSkin /
 dep id=mx.skins.spark:ContainerBorderSkin /
 dep id=spark.skins.spark:ErrorSkin /
 dep id=mx.skins.halo:BusyCursor /
 dep id=mx.core:UITextField /
 dep 
 id=_AdminPortal_Styles__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_89976
 7333 
 /
 dep id=mx.skins.spark:ButtonSkin /
 dep id=mx.core:IFlexModuleFactory /
 dep id=spark.skins.spark:SkinnableContainerSkin /
 dep id=mx.skins.spark:ScrollBarUpButtonSkin /
 dep id=mx.skins.spark:ButtonBarMiddleButtonSkin /
 dep id=mx.skins.halo:ToolTipBorder /
 dep id=mx.skins.spark:ScrollBarThumbSkin /
 dep id=mx.styles:IStyleManager2 /
 /script
 
 script name=_AdminPortal_FlexInit-generated.as mod=1281021648317
 size=7494 optimizedsize=6782
 def id=_AdminPortal_FlexInit /
 pre id=Object /
 dep id=spark.accessibility:TextBaseAccImpl /
 dep id=mx.collections:ArrayList /
 dep id=mx.messaging.messages:MessagePerformanceInfo /
 dep id=mx.managers.systemClasses:ChildManager /
 dep id=mx.messaging.messages:CommandMessage /
 dep id=en_US$containers_properties /
 dep id=mx.messaging.channels:HTTPChannel /
 dep id=mx.core:TextFieldFactory /
 dep id=mx.core:mx_internal /
 dep id=en_US$components_properties /
 dep id=en_US$logging_properties /
 dep id=mx.accessibility:UIComponentAccProps /
 dep id=mx.messaging.messages:AsyncMessageExt /
 dep id=mx.utils:ObjectProxy /
 dep id=en_US$layout_properties /
 dep id=mx.messaging.messages:AcknowledgeMessageExt /
 dep id=AS3 /
 dep id=mx.accessibility:AlertAccImpl /
 dep id=en_US$messaging_properties /
 dep id=en_US$collections_properties /
 dep id=mx.styles:StyleManagerImpl /
 dep id=mx.messaging.messages:HTTPRequestMessage /
 dep id=mx.messaging.messages:AcknowledgeMessage /
 dep id=en_US$skins_properties /
 dep id=mx.messaging.channels:SecureAMFChannel /
 dep id=mx.messaging.config:ServerConfig /
 dep id=en_US$core_properties /
 dep id=Error /
 dep id=en_US$styles_properties /
 dep id=mx.core:IFlexModuleFactory /
 dep id=mx.collections:ArrayCollection /
 dep id=flash.net:registerClassAlias /
 dep id=mx.effects:EffectManager /
 dep id=flash.net:getClassByAlias /
 dep id=en_US$controls_properties /
 dep id=en_US$effects_properties /
 dep id=mx.accessibility:LabelAccImpl /
 dep id=mx.accessibility:TabBarAccImpl /
 dep id=mx.messaging.channels:AMFChannel /
 dep id=flash.system:Capabilities /
 dep id=mx.messaging.config:ConfigMap /
 dep id=mx.messaging.channels:SecureHTTPChannel /
 dep id=mx.styles:IStyleManager2 /
 dep id=mx.messaging.messages:ErrorMessage /
 dep id=mx.accessibility:ButtonAccImpl /
 dep id=mx.messaging.messages:AsyncMessage /
 dep id=mx.accessibility:PanelAccImpl /
 dep id=mx.messaging.messages:CommandMessageExt /
 /script
 
 script 
 name=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Require
 d_1342721164.as 
 mod=1265215554000 size=1096 optimizedsize=385
 def 
 id=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Required_
 1342721164 
 /
 pre id=mx.core:SpriteAsset /
 dep id=AS3 /
 /script
 
 script name=_AdminPortal_mx_core_FlexModuleFactory.as
 mod=1281021648317 size=2781 optimizedsize=2042
 def id=_AdminPortal_mx_core_FlexModuleFactory /
 pre id=mx.core:FlexModuleFactory /
 pre id=mx.core:IFlexModuleFactory /
 pre id=flashx.textLayout.compose:ISWFContext /
 dep id=flash.system:Security /
 dep id=AS3 /
 dep id=mx.core:IFlexModule /
 dep id=flash.system:ApplicationDomain /
 dep id=flash.utils:Dictionary /
 dep id=mx.preloaders:SparkDownloadProgressBar /
 /script
 
 script 
 

Re: [flexcoders] Educate me on how to build an application

2010-08-05 Thread Alex Harui
The recommended practice has not changed.  Use modules if possible, sub-apps 
via the Marshall Plan if you are going to have different versions of the SDK in 
the various pieces.

Hopefully we will track down your issue soon.  Be aware that the extra 
sensitivity is a requirement of us solving a major problem for modules having 
to do with memory leaks.


On 8/5/10 4:16 AM, Wally Kolcz wko...@isavepets.com wrote:






I've been developing Flex apps for a while now and never had a problem
with Flex 3, then when Flex 4 came out I started running into all kinds
of problems with developing an application with modules. Whereas it's
well documented pertaining problems with loading Modules in Flex 4
regarding shared resources, it makes me wonder how to build a fast
loading large Flex app.

I use the Mate Framework and use Events to load data, trigger moves, and
load other pieces. I do not use the main application to call functions
or interface with the other modules. They pretty much run indepentent of
each other, only sharing RemoteObjects. I was under the assumption that
modules were a good way to break up pieces of an application to keep
each pieces smaller so they load quickly, but I am finding out that it
seems it is not the preferred way, so I thought I would ask the experts
for some education on how to achieve a application that is lightweight
but full featured.

Here is a break down of my application:

I have a portal online that is shared by 4 different types of users. The
main application loads basically a login box and a has a block of code
to load a module based on the user's account type. I  use stock (Module
Manager) loader ActionScript (see below) that loads one of 2 different
modules based on if the user is in one group (kids) or a site admin
(parents, a hospital, or myself for super admin rights) once they log
in.  Problem is that when the module loads it throws errors regarding
'One of the parameters is invalid.' and always having to do with the
Style Manager.

I broke the application down into about a dozen modules since the kid's
UI is complete different than the other three groups and, in the other 3
groups, they have access to different types of functionality based on
their user types. The kids application application has access to about
10 different types of views (arts  crafts, web cam chat, journal, chat
rooms, account manager, photo uploading/managing, etc). The admins
(parents, hospitals, myself) have access to journals, account managers,
analytics, etc). To keep the size of the application down I created
modules for each type of sub application and just load them when the
user wants to use them. I liken it to traditional web when each sub
application would be another page of the web site and the index page is
just a link to those pages.

In this scenerio, are modules not the best way to work? What are the
alternatives to creating 10 sub applications in a main application
without bloating the size? I know that creating each sub app as a
component is not the answer for 2 main reasons: Components are shared
pieces of an application and not full sub apps, and components are
complied into the application and the size.

So, to make a long question short (too late), what is the best method to
create an application with lots of 'pages' but not bloat the size of the
swf? If it is to break each sub application into a module, what is the
magic bullet that helps load them. I am currently using:

private function loadModule(path:String):void {
 modLoader = ModuleManager.getModule(path);
 modLoader.addEventListener(ModuleEvent.ERROR,
modErrorHandler);
 modLoader.addEventListener(ModuleEvent.READY,
modReadyHandler);
 modLoader.load();
 }

private function modErrorHandler(e:ModuleEvent):void {
 Alert.show(Module did not load correctly, Module
Loading Error);
 }

private function modReadyHandler(e:ModuleEvent):void {
 this.removeAllElements();
 this.addElement(modLoader.factory.create() as
IVisualElement);
 }

I guess my next question, what are the benefits to using ModuleManager
to load them or using Moduleloader?  Does one work better than the other?

I really want to continue with Flex and want to be a better developer,
but all these new errors with Flex 4 is very disappointing and SLOWING
down my development. Thanks!






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


Re: [flexcoders] Why does Flex 4 hate modules?

2010-08-05 Thread dorkie dork from dorktown
Is it possibly some of your components are still using references to
StyleManager (mx) and have not been updated to styleManager (spark).
http://www.jonathanrowny.com/journal/migrating-flex-4-stylemanager

2010/8/5 Alex Harui aha...@adobe.com



 Because I see _AdminPortal_FlexInit and
 _AdminPortal_mx_core_FlexModuleFactory, I'm guessing this is the
 link-report
 for the _AdminPortal module, not the main app.

 If you just add -link-report to the compiler options, both the main app and
 module will output the link-report to the same file, and since modules
 compile after apps, the module's link-report overwrites the apps. You have
 to find a way to only tickle an app rebuild or do what I do and just use
 ANT
 or command line.


 On 8/5/10 8:33 AM, Wally Kolcz 
 wko...@isavepets.comwkolcz%40isavepets.com
 wrote:

  After looking at the report I see things like (which makes no sense to
 me):
 
  script name=_AdminPortal_Styles.as mod=1281021647964 size=16395
  optimizedsize=15325
  def id=_AdminPortal_Styles /
  pre id=Object /
  dep id=mx.skins.spark:TabSkin /
  dep id=mx.core:UIComponent /
  dep id=spark.skins.spark:FocusSkin /
  dep id=mx.skins.spark:ScrollBarTrackSkin /
  dep id=mx.core:mx_internal /
  dep id=mx.skins.spark:PanelBorderSkin /
  dep id=mx.skins.spark:BorderSkin /
  dep id=mx.skins.spark:ButtonBarFirstButtonSkin /
  dep id=mx.skins.spark:ButtonBarLastButtonSkin /
  dep id=mx.styles:CSSCondition /
  dep id=mx.utils:ObjectUtil /
  dep id=AS3 /
  dep id=mx.skins.spark:ScrollBarDownButtonSkin /
  dep id=mx.skins.halo:HaloFocusRect /
  dep
 
 id=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Required_
  1342721164
  /
  dep id=mx.styles:CSSSelector /
  dep id=mx.styles:CSSStyleDeclaration /
  dep id=mx.skins.spark:DefaultButtonSkin /
  dep id=mx.skins.spark:ContainerBorderSkin /
  dep id=spark.skins.spark:ErrorSkin /
  dep id=mx.skins.halo:BusyCursor /
  dep id=mx.core:UITextField /
  dep
 
 id=_AdminPortal_Styles__embed_css_Assets_swf_mx_skins_cursor_BusyCursor_89976
  7333
  /
  dep id=mx.skins.spark:ButtonSkin /
  dep id=mx.core:IFlexModuleFactory /
  dep id=spark.skins.spark:SkinnableContainerSkin /
  dep id=mx.skins.spark:ScrollBarUpButtonSkin /
  dep id=mx.skins.spark:ButtonBarMiddleButtonSkin /
  dep id=mx.skins.halo:ToolTipBorder /
  dep id=mx.skins.spark:ScrollBarThumbSkin /
  dep id=mx.styles:IStyleManager2 /
  /script
 
  script name=_AdminPortal_FlexInit-generated.as mod=1281021648317
  size=7494 optimizedsize=6782
  def id=_AdminPortal_FlexInit /
  pre id=Object /
  dep id=spark.accessibility:TextBaseAccImpl /
  dep id=mx.collections:ArrayList /
  dep id=mx.messaging.messages:MessagePerformanceInfo /
  dep id=mx.managers.systemClasses:ChildManager /
  dep id=mx.messaging.messages:CommandMessage /
  dep id=en_US$containers_properties /
  dep id=mx.messaging.channels:HTTPChannel /
  dep id=mx.core:TextFieldFactory /
  dep id=mx.core:mx_internal /
  dep id=en_US$components_properties /
  dep id=en_US$logging_properties /
  dep id=mx.accessibility:UIComponentAccProps /
  dep id=mx.messaging.messages:AsyncMessageExt /
  dep id=mx.utils:ObjectProxy /
  dep id=en_US$layout_properties /
  dep id=mx.messaging.messages:AcknowledgeMessageExt /
  dep id=AS3 /
  dep id=mx.accessibility:AlertAccImpl /
  dep id=en_US$messaging_properties /
  dep id=en_US$collections_properties /
  dep id=mx.styles:StyleManagerImpl /
  dep id=mx.messaging.messages:HTTPRequestMessage /
  dep id=mx.messaging.messages:AcknowledgeMessage /
  dep id=en_US$skins_properties /
  dep id=mx.messaging.channels:SecureAMFChannel /
  dep id=mx.messaging.config:ServerConfig /
  dep id=en_US$core_properties /
  dep id=Error /
  dep id=en_US$styles_properties /
  dep id=mx.core:IFlexModuleFactory /
  dep id=mx.collections:ArrayCollection /
  dep id=flash.net:registerClassAlias /
  dep id=mx.effects:EffectManager /
  dep id=flash.net:getClassByAlias /
  dep id=en_US$controls_properties /
  dep id=en_US$effects_properties /
  dep id=mx.accessibility:LabelAccImpl /
  dep id=mx.accessibility:TabBarAccImpl /
  dep id=mx.messaging.channels:AMFChannel /
  dep id=flash.system:Capabilities /
  dep id=mx.messaging.config:ConfigMap /
  dep id=mx.messaging.channels:SecureHTTPChannel /
  dep id=mx.styles:IStyleManager2 /
  dep id=mx.messaging.messages:ErrorMessage /
  dep id=mx.accessibility:ButtonAccImpl /
  dep id=mx.messaging.messages:AsyncMessage /
  dep id=mx.accessibility:PanelAccImpl /
  dep id=mx.messaging.messages:CommandMessageExt /
  /script
 
  script
 
 name=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Require
  d_1342721164.as
  mod=1265215554000 size=1096 optimizedsize=385
  def
 
 id=_AdminPortal_Styles__embed_css_Assets_swf_mx_containers_FormItem_Required_
  1342721164
  /
  pre id=mx.core:SpriteAsset /
  dep id=AS3 /
  /script
 
  script name=_AdminPortal_mx_core_FlexModuleFactory.as
  mod=1281021648317 size=2781 optimizedsize=2042
  def id=_AdminPortal_mx_core_FlexModuleFactory /
  pre 

[flexcoders] Problem with adobe call

2010-08-05 Thread Dan Pride
I am taking over an app that has the following wrong call

   import com.adobe.serialization.json.JSON;

Any suggestions on the proper one? 

All I get is viewsource in the suggestion list

Thanks
Dan Pride
danielpr...@yahoo.com


  


Re: [flexcoders] Problem with adobe call

2010-08-05 Thread Oleg Sivokon
That's not a call, that's an import. You are missing sources or SWC in your
project.