tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/947-joel-hooks-tutorial-for-learning-robotlegs-complete-n00bie-problem-error-1114Robotlegs: Discussion 2012-07-10T12:36:38Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/171783322012-07-09T15:48:16Z2012-07-09T15:48:17ZJoel Hooks' tutorial for learning Robotlegs: complete n00bie problem: Error 1114...<div><p>Hi,</p>
<p>I am starting to look into the use of Robotlegs and was working
through Joel Hooks' tutorial: An Introduction to Robotlegs AS3 Part
1: Context and Mediators. I have re-created the project, project
structure looks as so:</p>
<p>RobotlegsIntro01</p>
<blockquote>
<p>src</p>
<blockquote>
<p>(default package)</p>
<blockquote>
<p>HelloWorld.mxml</p>
<p>HelloWorldContext.as</p>
<p>MessageView.mxml</p>
<p>MessageViewMediator.as</p>
</blockquote>
</blockquote>
</blockquote>
<p>Inside HelloWorldContext.as, I have copied the code from the
tut, so it looks like this:</p>
<p>import org.robotlegs.mvcs.Context</p>
<pre>
<code>public class HelloWorldContext extends Context
{
override public function startup():void
{
//bootstrap here
mediatorMap.mapView(MessageView, MessageViewMediator);
}
}</code>
</pre>
<p>but when declared in HelloWorld.mxml, where HelloWorld.mxml is
the main application, like so:</p>
<p><?xml version="1.0"?><br>
<s:Application</p>
<pre>
<code>xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:local="*">
<fx:Declarations>
<local:HelloWorldContext contextView="{this}"/>
</fx:Declarations>
<local:MessageView top="40" width="100%" height="100%"/></code>
</pre>
<p></s:Application></p>
<p>I receive the following error in HelloWorldContext.as:</p>
<p>1114: The public attribute can only be used inside a package.
HelloWorldContext.as /RobotlegsIntro01/src line 3</p>
<p>Can anyone tell me what I'm doing wrong? This has me baffled,
but I really want to understand RobotLegs. Any help would be much
appreciated.</p>
<p>Cheers,<br>
~Chipleh</p>
<p>p.s. - I have uploaded my source as well in case anyone fancies
a look.</p></div>Chiplehtag:robotlegs.tenderapp.com,2009-10-18:Comment/171783322012-07-09T17:57:03Z2012-07-09T17:57:05ZJoel Hooks' tutorial for learning Robotlegs: complete n00bie problem: Error 1114...<div><p>Nevermind, I found my answer after tweaking the code. Indeed, I
needed to add packages to the code, which in turn created new
errors within the HelloButton.mxml. Once I converted s:Group to
s:Button, I had the app working. Like i said, I'm a n000b, but am
liking the Robotlegs paradigm. I am using Flash Builder 4.6, not
sure if this was the cause of any of my probs, but regardless,
thanks for these tutorials Joel.</p></div>Chiplehtag:robotlegs.tenderapp.com,2009-10-18:Comment/171783322012-07-10T12:36:35Z2012-07-10T12:36:35ZJoel Hooks' tutorial for learning Robotlegs: complete n00bie problem: Error 1114...<div><p>I tend to chop things in the code listings for brevity when I
think they are "obvious". Sorry about that :)</p></div>Joel Hooks