This content has been marked as final. Show 6 replies
Use debug and put a breakpoint in your main app where it instantiates the first "module". You will have to trace down every call to module to see what is going wrong.
"TheKoelnKalk" <firstname.lastname@example.org> wrote in message
> I have a flex app with nested modules. The root is the main application
> consumes one module, and that module consumes many other modules (3 levels
> to say).
> What now happens is, that when the main application is loaded that one
> it will be loaded (or instantiated) multiple times. Interesting here is
> the modules is as much loaded as the amount of 3rd level modules it
> I am checking the whole stuff for lots of hours, tripple checked
> not to accidentally have the parentDocuments re-instantiated or something
> now I am totally lost.
> This problem causes e.g. everything to be computed at nearly the same
> e.g. the same images get loaded over and over again (like 10 times in a
> wich causes weird conflicts and strange app behaviour, especially when it
> to httpservice requests (Images disappearing, data is "lost", etc.).
> I wish I could explain it better but I cannot even explain that bevaviour
> properly in my own language :D
> Would be nice if someone could provide me with an idea!
You may find Q8 provides some insight:
sure, I read through all this before.
however, I found out that this issue belong to the state.
When I enter a certain state in my application it seems that the enterstate event fires a couple of times wich leads to the issue that all the code within this state is running multiple times.
anyone knows about this problem?
Its all different than I thought.
I use this to create instances of my modules lazily:
this it not within a loop or something, but as I found out using the creationComplete even in the mxml tag, the creation is done multiple times.
So one call cause to instantiate that module a couple of time. And what is still interesting: It creates the module as much of the amount of sub-modules it includes oO
I got it
if you set this (as I had before)
it seems to recursively create all sub components although in the docs it is said the default would be "false".
holy cow again...
Ok I tracked down everything now and it seems that "somehow" flex re-creates even the main application when doing this
could it be that flex follows even the backreferences on its path down to all component, back to the main app and then creates the components again? shouldnt this lead to an infinte loop then?
however, when I set it to "false" nothing is created at all except the root element : (