1070..... Context was not found
I have an odd issue here, I am creating a Flash project and
using Flash Builder 4, I added both the robotlegs framework.swc and
SwiftSuspenders.swc files to my Library Path in Flash Builder,
Created a Class through Flash Builder and extended the Context. As
soon as the class is created Flash Builder throws the following
error on the line of my class declaration:
1017: The definition of base class Context was not
found.
If i type manually public class MenuContext extends
org.robotlegs.mvcs.Context
flash builder will code complete,
but yet I still get the 1017 error above.
`Here is my Code:
import flash.display.DisplayObjectContainer;
import org.robotlegs.mvcs.Context;
public class MenuContext extends Context
{
//- PROPERTIES - //
//- CONSTRUCTOR - //
public function MenuContext(contextView:DisplayObjectContainer=null, autoStartup:Boolean=true)
{
super(contextView, autoStartup);
}
}`
Any Ideas?
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
1 Posted by Joe on 24 Jun, 2011 08:02 PM
Ok, This seems to happen only when I create a property of the MenuContext Type in my document class for my flash file. I am not even instantiating a new object. like so:
`
`
I am very confused as the An Introduction to Robotlegs AS3 Part 2: Models tutorials says to do just that.
Support Staff 2 Posted by creynders on 25 Jun, 2011 07:22 AM
Not sure whether it's related to the error you're getting, but the framework.swc already contains the swiftsuspenders lib, so you shouldn't add it separately. My guess is, that since the context creates the swiftsuspendersadapter, which in turn references the swiftsuspenders lib FB actually gets confused on what version of SS to use and therefore is not able to pre-compile the context class, hence it's "missing". Or something like that ;)
3 Posted by visnik on 05 Jul, 2011 04:27 PM
creynders,
I did remove the linkage to the swftsuspenders in my build path and left only the framework-v1.0.0swc. This did not solve the issue.
Support Staff 4 Posted by Ondina D.F. on 06 Jul, 2011 10:10 AM
Hi Joe,
There is definitely a problem with the Build Path in your project.
I tried to reproduce the error you’ve got in a very rudimentary example that works just fine for me:
ApplicationContext
Main View:
ApplicationMediator:
To reproduce the error 1017: The definition of base class Context was not found. :
I deleted the robotlegs.swc file from the libs folder.
Then I added it to the libs folder again, and I still got the same error.
Then I went to Project->Clean and after that everything went back to normal.
So maybe that’s what happened to you: at some time you deleted the robotlegs.swc and maybe added a new version, but FlashBuilder didn’t notice the change. “Clean” is refreshing the bin-debug and the project settings, that somehow contain mixed values, old and new, which confuses the poor FlashBuilder :)
If that doesn’t work for you try this:
What I do when something goes really wrong with a project’s settings in FB is:
1. right click on the project in the Package Explorer, choose Delete
2. radiobutton: DO NOT DELETE CONTENTS !!
3. go to the folder of the project on your hard-disk
4. delete :bin-debug, .settings, .actionScriptProperties, .flexProperties, .project
5. and eventually the libs content
6. don’t delete src !!
7. go back to FB, create a new Flex Project with the same name (RLTest) and location
The structure of your project will be intact, you’ll just have new settings.
( from my response in this thread http://knowledge.robotlegs.org/discussions/problems/246-the-definit... )
In your case I would add the robotlegs.swc to the libs folder before opening FB again and in FB I would go to Project->Properties->Build Path-> add swc folder
Tell me if it helped :)
Ondina
5 Posted by visnik on 06 Jul, 2011 04:48 PM
Ondina,
Last night I created an new flash project, and got the same thing from the get go, I saw your reply above today and did exactly what you said, no go still have the same issue. I then looked at your link above, and it is exactly the same issue Kyle had..
In Kyle's post you asked him "Can you see the robotlegs swc under your Referenced Libraries (FB Package Explorer) and the Context.abc under org.robotlegs.mvcs there?" I can see the Context.abc file, I will include a screenshot. I also looked under my .actionScriptProperties and it shows the following
`<?xml version="1.0" encoding="UTF-8" standalone="no"?>
`
This is a Flash project and not a air or flex project. I will include the entire project if you or anyone else wants to take a look.
the two errors I get is:
1017: The definition of base class Context was not found.
1020: Method marked override must override another method.
Thanks,
Joe
Support Staff 6 Posted by Ondina D.F. on 06 Jul, 2011 05:14 PM
Hey Joe,
I just took a look at your project :) It works - as an ActionScript project!!!
Could you read this?
http://knowledge.robotlegs.org/discussions/solutions/13-some-flashb...
I wrote it after my first reply in this thread.
If it still doesn’t work, we should take it step by step. Let me know how it goes.
Ondina
Support Staff 7 Posted by Ondina D.F. on 06 Jul, 2011 05:35 PM
Hmm, I took a closer look at your .actionScriptProperties, and I think, I found your problem.
It is because the Link type you chose was External.
Try Merged into code. It worked for me and it will work for you too!! If not, shoot me;)
Ondina
8 Posted by visnik on 06 Jul, 2011 06:05 PM
Ondina,
I did read it right after I made my last post as i saw it pop up and was directly related. I noticed i did not have a libs folder so I created one and placed the swc files in it. I then went into my build path and removed the path I originally had to the swc files and added the path to reflect my libs directory in my project.... still no change. If you were able to get it to run with out issue, I was wondering if it is my machine. I took the project over to a coworkers machine and see if i could get it to run there, but same thing happened.
[edit] I saw your above post after I posted this one. I went into flash builder build path and made sure Framework linkage was Merged into code. I then looked at my actionscriptproperties and saw a linkType="1", should this be 0 or some other value?
Thanks.
Joe
Support Staff 9 Posted by Ondina D.F. on 06 Jul, 2011 06:18 PM
That’s what I get in an air app, if I change the linkage type from merged into code to external:
VerifyError: Error #1014: Class org.robotlegs.mvcs::Context could not be found.
I always had the Link type: Merged into Code, so it never happened to me before. I didn’t know that could be a problem with the robotlegs.swc until now.
I don’t know. I’ll have to take a closer look at my .actionScriptProperties.
But I will have to go in a few minutes, so I guess I won’t be able to help you right now.
Just a quick question:
Have you tried any of the many robotlegs examples?
Do they work, or are you getting errors?
Later today or most probably tomorrow I will try to see what else could be an issue.
Maybe you could try to create a new project on the other machine and also to load a robotlegs example, to see if they work there.
What version of FlashBuilder do you use? Maybe it’s a bad bad bad version?;)
Ondina
10 Posted by visnik on 06 Jul, 2011 07:32 PM
No worries, I don't have a deadline with it or anything, just wanted to build a RL project as Flash instead of Air or Flex. I have built other projects with robot legs, flex and air, both have no context issue, it just seems to only happen when I do a Flash project.
I am Running Flash Builder 4, and tried compiling with both Flex SDK 4.0/Flash Player 1.0.0 and Flex 4.5.1/Flash Player 10.2.0 and still get the class Context was not found error. I am looking at an Air app that is using robot legs and the actionscriptproperteis has a linkType="1", so I will assume that is what it should be with my flash projects as well.
I will see if i can find some RL flash examples and see if i get he same issue.
I'll check back tomorrow
I appreciate that you are taking the time to help me with this issue. Thanks Ondina.
Support Staff 11 Posted by Ondina D.F. on 07 Jul, 2011 02:58 PM
O.K. I’m back.
My pleasure, I like to find bugs :)
You said that you followed all the steps I described in my previous posts, so your ActionScript project has a valid robotlegs library linked to it.
Could it be that after trying so many times that many different options, you became increasingly frustrated and overlooked a little detail? :)
Let’s recap and clarify some things.
Sorry for repeating myself and for stating the obvious or for telling you to do things you’ve already done, but I don’t know how else to address this issue.
I am using:
FlashBuilder 4.5
Flash SDK 4.5.1
Flash Player 10.2
robotlegs-framework-v1.4.0.swc
We both have the same FB , FP and robotlegs versions, right?
We both use the same project files, namely your CarouselMenu - ActionScript Project
It works on my machine. You tried it on 2 different machines without success.
You have other robotlegs projects (flex and air) running with no issues.
So, the culprit seems to be Flash Builder when creating an ActionScript project.
As already mentioned, the difference between an AIR and/or Flex Project and an ActionScript Project is the fact
that FlashBuilder creates an empty libs folder only for air and/or flex projects, if there wasn’t one already,
or if there is a libs folder containing a library, FlashBuilder automatically includes the library file.
What I did:
after unzipping your file to a CarouselMenu folder,
I deleted your .settings, bin-debug, htm-template, .actionScriptproperies, .project ,
I created a libs folder, and put the robotlegs-framework-v1.4.0.swc in there,
I created a new ActionScript project using the location of CarouselMenu,
and in Build Path I added the libs folder and made sure the link type was merged into code
Just for clarification:
In my panel ActionScript Build Path there are 2 folders listed:
-Flex 4.5.1 (the flex framework sdk ) and libs (robotlegs framework)
There is also a dropdown “Framework linkage”. That’s referring to the Flex sdk.
If I open the libs folder, I see
-Link Type: Merged into code - this is the linkage for my own libraries
-robotlegs-framework-v1.4.0.swc
If I click on the Link type in the lib folder or hit Edit while Link type is selected, a new panel appears and there I can switch between merged and external.
When I was talking about changing the linkage type, I was referring to the one in the libs folder. I just wanted to make sure, that we were talking about the same options. I think that the dropdown “Framework linkage” is a bit confusing - it changes only the flex framework’s linkage. But actually I’m looking now at the attached screenshot and I see that you know about the option I talked above.
I also see that you have other libraries listed and also a src folder?? There isn’t a flex sdk.
Are you sure you were selecting ActionScript Project and not a Flash Professional Project from the menu when you created a new project?? I can’t see how FB behaves with a Flash Project, because I don’t have the latest Flash Professional installed.
I still think that the linkage type is an issue or that FlashBuilder doesn’t have the proper url for the library or that it get’s confused by the settings in your Library Path.
To verify that theory you should try to:
A.
Load the appended project that I created from scratch. Actually is the same as yours, just added a mediator for the main view and there is a different package structure. See if it works.
You can try it by keeping my setting and also one more time after deleting them.
You can copy the .actioScriptProperties to another location before deleting it, and maybe compare it with your own, after FB is generating it for the project?
I’ve noticed your
libraryPathEntry kind="1" linkType="1" path="C:/Users/jcolumbe/Desktop/External swc and AS Libraries/RobotLegs"/
It seems there is a shared folder containing the robotlegs swc on your C drive. I don’t think that should cause problems, but just for the sake of finding a solution, try to use the libs folder in your project. You don’t need to specify the path for the attachment, if you select the right libs folder.
Mine:
when it’s external
libraryPathEntry kind="1" linkType="2" path="libs"
when it’s merged
libraryPathEntry kind="1" linkType="1" path="libs"
B.
1. create an ActionScript project from scratch,
letting FlashBuilder create the folders for you, at a location of your choice, not the default one
2. give the project a complete different name from the one that doesn’t work
3. go to the project location
4. Create a folder libs on your hard drive
5. put only the robotlegs-framework-v1.4.0.swc inside the libs folder
6. go back to FB - Build Path and add the libs folder
7. create you robotlegs classes with a different package structure
8. run the project
N.B. I tried to see if there is an issue with adding both robotlegs and swiftsuspenders libraries. It worked fine, but creyenders is right, robotlegs already contains the swiftsuspenders, so you don’t need it and who knows how confused FB can get ;)
C.
Since you mentioned it in your post, download SimpleListExample from http://www.developria.com/2010/06/an-introduction-to-robotlegs-a-1.... ( I tried it, and it worked) try to load the project and run it
D.
In case it still doesn’t work:
- has the project references to other projects?
are you using the default project location when you create a new project?
are you linking the libs folder from another project?
try to close all other projects
verify that the classes you import are in the right package
restore defaults in all the properties panels, if you can afford it
I’m out of ideas:) Oh wait! Reinstall FlashBuilder? Some may say, use another IDE?
Maybe you already did all of the above mentioned, so sorry again for the redundancy.
But since I wrote so much already, I will post it as is.
I hope very much that you get this one sorted:) I know how frustrating it is even if there isn’t a deadline.
Ondina
12 Posted by visnik on 07 Jul, 2011 07:26 PM
Ondina,
Just a quick reply to your post, I am about to start systematically going through each option you have listed above, but here is some info about my project setup.
I am using:
Flash Builder 4.0
Flash SDK 4.0
Flash Player 10.0.45
robotlegs-framework-v1.4.0.swc
I can change it to Flash SDK 4.5.1 and Flash Player 10.2.0, I will give that a shot as well.
“Are you sure you were selecting ActionScript Project and not a Flash Professional Project from the menu when you created a new project??”
I am selecting a Flash Professional Project (as my Graphic Designers use Flash Professinal), not an actionscript project
I will post back after I got through each option you have listed above.
Thanks,
Joe
13 Posted by visnik on 07 Jul, 2011 07:52 PM
OK, tried the following:
after unzipping your file to a CarouselMenu folder, I deleted your .settings, bin-debug, htm-template, .actionScriptproperies, .project ,
I created a libs folder, and put the robotlegs-framework-v1.4.0.swc in there,
I created a new ActionScript project using the location of CarouselMenu,
and in Build Path I added the libs folder and made sure the link type was merged into code
This fixed it, the error looking for the missing context error, however this does not allow integration with the CarouselMenu.fla file (or at least that not that I am aware of.), so I opened the fla file in Flash Professional CS5 and set the CarouselMenu.as to be the document class…. Boom error popped right back up, but only in the compile errors tab of the Flash Professinal CS5 IDE, not in FB.
This leads me to believe this context issue might be because I am using a .fla file.
Trying the next option.
14 Posted by visnik on 07 Jul, 2011 08:37 PM
ok, just did your second suggestion:
Load the appended project that I created from scratch. Actually is the same as yours, just added a mediator for the main view and there is a different package structure. See if it works.
no issue, worked just fine.
on to the next one.
15 Posted by visnik on 07 Jul, 2011 08:54 PM
As I work through these, it is seeming more and more like using a Flash Professional project that incorporates an .fla file is the culprit.
Support Staff 16 Posted by Ondina D.F. on 08 Jul, 2011 12:55 PM
My bad!!
You specified that it was a Flash Project from the beginning of this thread, but I don’t know why, I first assumed that you were opening it as an ActionScript Project in FB.
I’ve never loaded a Flash Project in FB until now. For a while now I’ve been working on AIR and Flex projects almost exclusively and I use only FlashBuilder for that.
As I don’t have the Flash CS 5.5 installed on this machine, I had to try it on someone else’s machine. Now I’m writing this post without seeing the Flash Professional 5.5 settings, so I hope I remember everything correctly.
Flash Professional
I loaded your CarouselMenu.fla in Flash
I set CaruselMenu.as as to be the document class
tested the project
and voilà, the errors, you had trouble with, appeared
Then I went back to Publish Settings - Script Settings and I added libs (merged) to the library path and the src
Tested the fla again
Same errors
Then I went to Preferences-ActionScript-Language ActionScript3 - Advanced Settings and I added the path for the src folder in the Source path window, the path for the libs folder in the Library path window and I left External library path empty
Tested again and it worked!!!!!!! The errors disappeared, meaning that setting the path (in the Preferences) for the included actionscript library is essential
Flash Builder
In FB I chose new Flash Professional Project and specified the paths for fla and src (the src folder in the flash professional project, not the default)
FB created the project, but all the flex/flash imports couldn’t be found
So I went to FB Build Path and saw something similar to your screenshot. There was no Flex SDK. I added it and then everything was ok. Since I added the robotlegs swc in Flash there was no need to add it again in FB
I ran the FB project and it worked!!!
After that I saw that it’s possible to specify the path to the Flex SDK in Flash Pro in Preferences-ActionScript-Language ActionScript3-, before creating a Flash Project in FB. Doing so you don’t have to add the flex SDK in FB.
Conclusion: Robotlegs and Flash Builder are behaving as they should.
Flash Professional is the culprit. I find its menus pretty confusing, especially for someone like me, who is not using it on a daily basis.
It took me a while to remember where you can set a document class and a library path.
Then I accidentally added the robotlegs in the Publish Settings panel instead of Preferences.
Could it be that happened to you too?
Hopefully my explanation wasn’t too confusing and you can make your CarouselMenu work on your computer too :)
Ondina
Support Staff 17 Posted by Ondina D.F. on 09 Jul, 2011 10:02 AM
Just for the sake of completeness I created a new Flash project in Flash Professional (CS4), to see if a robotlegs project works in there without issues.
I wanted to see under which circumstances I’d get an error (of any kind) related to the robotlegs framework.
So I started without modifying the default settings in Publishing and Preferences => Error: Context not found etc. That’s a missing path issue.
I did the same, as explained in my previous post, added the libs folder under Preferences => Errror: Cannot access a property or method of a null object reference. That’s the famous metadata issue.
In Publishing Settings - SWF Settings I made sure Export SWC was checked. (That’s the same as adding compiler arguments in FB -keep-as3-metadata)=> no more issues.
So obviously Export SWC was checked in my experiment from yesterday, that’s why it was working.
I think it would work in Flash CS5 as well.
I’m curious if that solves your problem. I’ll be on vacation for a week, but I will be able to at least read your feedback. Good luck, Joe :)
Ondina
Support Staff 18 Posted by Ondina D.F. on 09 Jul, 2011 11:04 AM
And because the installation of Flash Professional CS5.5 has just been completed, I opened the flash project in there, and I saw that the Publish SWC is selected by default under Publish Settings.
I just had to specify the document class under Publish Settings - ActionScript3- Advanced Settings and to add the libs path under Preferences. I created the Flash Project in FB and didn’t have to change or add anything in Build Path.
I had no problems running it.
I don’t know if it’s of any use, but I appended the project.
Ondina
19 Posted by visnik on 12 Jul, 2011 02:51 PM
Ondina,
That is awesome, I have gotten a little busy at work, but I will defiantly try your suggestions and play around with this asap. I am confident it will work for me, I'll keep you posted. Thanks for all the help, and time you have taking to help me with this problem.
Joe
20 Posted by visnik on 29 Jul, 2011 08:12 PM
Sorry it took me so long to get back to this thread, but I did what you said and all is good, it worked fine, Export swc defiantly seems to be the culprit.... Thanks your your help on this one.
Support Staff 21 Posted by Ondina D.F. on 30 Jul, 2011 09:06 AM
You’re welcome, Joe, and I’m glad that we found the culprit (Flash Professional) and that our discussion led to a solution :)
( fake tags: Actionscript Project, Flash Professional Project in FlashBuilder, Context could not be found, Cannot access a property or method of a null object reference, Export SWC )
You can close the discussion, if there are no more questions.
Ondina
22 Posted by visnik on 02 Aug, 2011 03:53 PM
I can't seem to close the discussion, the link is grayed out, wont let me click it.
Ondina D.F. closed this discussion on 01 Nov, 2011 11:37 AM.