tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/382-context-startup-method-suddenly-stopped-firing-helpRobotlegs: Discussion 2018-10-18T16:35:32Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T18:47:56Z2011-09-22T18:47:56ZContext startup() method suddenly stopped firing - HELP!<div><p>Hey guys,<br>
I've been chugging along on my project, everything building fine,
just going through the debug process. When I left the project last
night, everything was building properly. This morning, I go to
build my project, and for some reason the startup() method in my
context no longer gets called. I've tried cleaning my project,
rebooting my machine, and just about every other random idea I
could come up with, but it still is not firing. I can't find
anything in my code that would be causing this, my context
declaration inside of my main application still appears to be
correct, and is passing in contextView="{this}" as it always has. I
know that the context is being created because the constructor does
get called.</p>
<p>Any thoughts on what might be causing this???</p>
<p>Thanks!</p>
<p>-Kyle</p></div>Kyletag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T18:56:38Z2011-09-22T18:56:38ZContext startup() method suddenly stopped firing - HELP!<div><p>More Info:<br>
I am using Flashbuilder 4.5 on Mac OSX Lion. I have tried running
as both a debug build and a normal build, and just in case it was a
metadata stripping issue, I have tried adding the following
compiler options:</p>
<p>-keep-as3-metadata+=Inject -keep-as3-metadata+=PostConstruct</p></div>Kyletag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:11:08Z2011-09-22T19:11:08ZContext startup() method suddenly stopped firing - HELP!<div><p>Kyle,<br>
How are you instantiating your robotlegs context?</p>
<p>You may need to set autoStartup to true or dispatch the context
startup event</p>
<p>dispatchEvent( new ContextEvent(ContextEvent.STARTUP) );</p>
<ul>
<li>Dave</li>
</ul></div>digitaldavenyctag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:12:01Z2011-09-22T19:12:01ZContext startup() method suddenly stopped firing - HELP!<div><p>More More Info:<br>
Digging through Context.as and adding a few breakpoints, it appears
that the onAddedToStage() method never gets called. It looks like
this is what actually calls the startup() method, so perhaps the
question is: Why is the onAddedToStage() method not getting called?
Any ideas on that?</p></div>Kyletag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:14:09Z2011-09-22T19:14:39ZContext startup() method suddenly stopped firing - HELP!<div><p>Hey Dave,<br>
I have a Flex project, and I'm instantiating my context in my main
application file in the declarations tag (this has been working
just fine for the last few weeks).</p>
<pre>
<code> <fx:Declarations>
<!-- Context File -->
<videoplayer:VideoPlayerContext contextView="{this}" />
</fx:Declarations></code>
</pre>
<p>It doesn't appear that you can access the autostartup via MXML
(not exposed via a setter).</p></div>Kyletag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:20:54Z2011-09-22T19:20:54ZContext startup() method suddenly stopped firing - HELP!<div><p>When checkAutoStartup() gets called in the context, it executes
the following code:</p>
<pre>
<code> contextView.stage ? startup() : contextView.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);</code>
</pre>
<p>The result of this is that the listener gets added since at the
time this method fires, contextView.stage is reporting null. Again,
not sure why this would suddenly start happening, as it has been
working fine for the last few weeks, and I can't think of any
coding change that i could make that would effect this...</p></div>Kyletag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:28:00Z2011-09-22T19:28:00ZContext startup() method suddenly stopped firing - HELP!<div><p>You can set it in your VideoPlayerContext class</p>
<pre>
<code>public class VideoPlayerContext extends Context
{
public function VideoPlayerContext(contextView:DisplayObjectContainer, autoStartup:Boolean = true)
{
super(contextView, autoStartup);
}</code>
</pre></div>digitaldavenyctag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:40:10Z2011-09-22T19:40:10ZContext startup() method suddenly stopped firing - HELP!<div><p>Right on!</p>
<p>At this point it's starting to look like one of my view
components might be causing the issue. I've gone line by line
removing various uicomponents/views from my application file, and I
think I've found the culprit. It's an extremely strange behavior,
basically, a single component is somehow (silently, i.e. no
problems reported, no errors thrown) causing the Applications
applicationComplete, and creationComplete events not to fire, which
is what I assume is breaking the context and not allowing it to
fire its' startup method. I will report back when I figure this
thing out!</p>
<p>Thanks,</p>
<p>Kyle</p></div>Kyletag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:45:03Z2011-09-22T19:45:03ZContext startup() method suddenly stopped firing - HELP!<div><p>I found the culprit. The following 3 lines of code managed to
single-handedly (and silently) bring down the entire application
and prevent the applicationComplete events from firing in the main
Application file:</p>
<pre>
<code> <s:stroke>
<s:SolidColorStroke color="{getStyle('accentColor')}" alpha="{getStyle('accentAlpha')}" />
</s:stroke></code>
</pre>
<p>I don't think there's enough room in the DB to store the amount
of gripes (see also issues, see also complaints) about Flashbuilder
4.5 and it's insane bugginess, but needless to say I'll be adding
this to the long, long list...</p>
<p>Thanks for the help Dave!</p></div>Kyletag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:52:26Z2011-09-22T19:52:26ZContext startup() method suddenly stopped firing - HELP!<div><p>Kyle,<br>
That sounds like it could be part of your problem, robotlegs should
be living at the top level of your application not just a view
component from within it. You can use it in the way that you are
but it's not considered a good practice and you run into problems
more frequently like the one you just had. I agree anything in
eclipse is mediocre at best. Glad to help and good luck.</p>
<p>Cheers,<br>
Dave</p></div>digitaldavenyctag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T19:58:46Z2011-09-22T19:58:46ZContext startup() method suddenly stopped firing - HELP!<div><p>Hey Dave,<br>
Robotlegs (i.e. my context) DOES live at the top level of my
application. It is declared in the tag of my main application file.
The view component I was referring to was a child element of my
main application, and was a separate component (having nothing to
do with my context).</p></div>Kyletag:robotlegs.tenderapp.com,2009-10-18:Comment/101446402011-09-22T20:09:31Z2011-09-22T20:09:31ZContext startup() method suddenly stopped firing - HELP!<div><p>Gotcha seemed like you were nesting inside your app, my
fault.</p></div>digitaldavenyc