Joel Hooks' tutorial for learning Robotlegs: complete n00bie problem: Error 1114...

Chipleh's Avatar

Chipleh

09 Jul, 2012 03:48 PM

Hi,

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:

RobotlegsIntro01

src

(default package)

HelloWorld.mxml

HelloWorldContext.as

MessageView.mxml

MessageViewMediator.as

Inside HelloWorldContext.as, I have copied the code from the tut, so it looks like this:

import org.robotlegs.mvcs.Context

public class HelloWorldContext extends Context
{
    override public function startup():void
    {
        //bootstrap here
        mediatorMap.mapView(MessageView, MessageViewMediator);
    }
}

but when declared in HelloWorld.mxml, where HelloWorld.mxml is the main application, like so:

<?xml version="1.0"?>
<s:Application

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%"/>

</s:Application>

I receive the following error in HelloWorldContext.as:

1114: The public attribute can only be used inside a package. HelloWorldContext.as /RobotlegsIntro01/src line 3

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.

Cheers,
~Chipleh

p.s. - I have uploaded my source as well in case anyone fancies a look.

  1. 2 Posted by Chipleh on 09 Jul, 2012 05:57 PM

    Chipleh's Avatar

    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.

  2. Support Staff 3 Posted by Joel Hooks on 10 Jul, 2012 12:36 PM

    Joel Hooks's Avatar

    I tend to chop things in the code listings for brevity when I think they are "obvious". Sorry about that :)

  3. Joel Hooks closed this discussion on 10 Jul, 2012 12:36 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac