Select to view content in your preferred language

Error of API 3.0

2388
9
11-30-2012 02:27 PM
hwangdong_jun
New Contributor
Hello, I'm Korean Student.
I can not speak English.
But, I need your help.

Error occurred while using the Flex API 3.0 06-June-2012 Version

[Error Message]
ReferenceError: Error #1065: ë³?ì?? JSONì?´(ê°?) ì ?ì??ë??ì?´ ì??ì§? ì??ì?µë??ë?¤.
at com.esri.ags.utils::JSONUtil$/decode()
at com.esri.ags.tasks::BaseTask/handleResultEvent()
at mx.rpc::AsyncResponder/result()
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

maybe, I think api path hard coding
Help me. Thank you.

My email address is sin_01@naver.com

PS. API 2.5 Version is Success
Tags (2)
0 Kudos
9 Replies
BjornSvensson
Esri Regular Contributor
Maybe your problem is related to:
* The "JSON" class has been renamed "JSONUtil". This was done because Flash Player 11 introduced a native JSON class.

To upgrade your code from version 2.x to 3.x, please see
http://resources.arcgis.com/en/help/flex-api/concepts/index.html#/Migrating_from_2_5_to_3_0/017p0000...
0 Kudos
jimplouplou
New Contributor
Hello !

I have just start a new project with the 3.1 lib. And i have the same error when i launch some samples....

Error #1065: La variable JSON n'est pas d襩nie. (JSON variable is not define)
at com.esri.ags.utils::JSONUtil$/decode()[C:\checkout\flex_api3\api\src\com\esri\ags\utils\JSONUtil.as:65

i don't have the hand on source code, so, it's hard to see what happen...

Thanks
0 Kudos
DasaPaddock
Esri Regular Contributor
Are you using Flex SDK 4.6 or greater?
0 Kudos
stevemclaughlin
Occasional Contributor
I'm getting the same error:
ReferenceError: Error #1065: Variable JSON is not defined.
at com.esri.ags.utils::JSONUtil$/decode()
at com.esri.ags.tasks::BaseTask/handleResultEvent()
at mx.rpc::AsyncResponder/result()
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

I'm using Flex 4.5, I'm upgrading from arcgis 2.4 to 3.0, and I've changed all my
import com.esri.ags.utils.JSON;
to:
import com.esri.ags.utils.JSONUtil;

and all my
var oResult:Object = JSON.decode( event.result.toString() );
to
var oResult:Object = JSONUtil.decode( event.result.toString() );

and I now get this error.
thanks,
steve
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Steve,

   The Flex API 3.0 requires Adobe Flex SDK 4.6

see System requirements
http://resources.arcgis.com/en/help/flex-api/concepts/017p/017p0000000m000000.htm
0 Kudos
PierreLarondelle
Regular Contributor
Hi Robert,

Does the 3.1 api requires a version of Flash Builder and/or Flex sdk higher than 4.6 ?

I'm facing a strange behaviour : Widgets that runs perfectly well in 3.0 and don't return errors after compilation with 3.1 swc, don't work anymore as I test them in the latest version of the Viewer.

To be sure, I've compiled (respectively in 3.0 API and in 3.1 API) the same ultra basic test widget with 2 buttons and a tab navigator (2 pannels).

The 3.0 version runs and the buttons appears clickable as well as the automation of the tab switches the pannels correctly.

The 3.1 version lets the widget opening and showing the same design but the buttons stay flat and the switching between the pannels don't work.

I've verified carefully that there's no mismatch between widget version and Viewer for Flex version, all is quite right. No problem with the Viewer itself too, the genuine esri's widgets are doing their jobs.

I'm a bit lost with this 3.1 as I don't encounter any error after compilation nor any info message telling me that I'm doing something wrong ...

Thanks for any help !
Have a nice day,
Pierre.
0 Kudos
BjornSvensson
Esri Regular Contributor
Does the 3.1 api requires a version of Flash Builder and/or Flex sdk higher than 4.6 ?


No, they both require Flex 4.6 SDK or higher.
http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Getting_started_for_developers/...
0 Kudos
PierreLarondelle
Regular Contributor
Bjorn, my FB is 4.6 so it's ok. Good news.

Can you, or anyone, give me an idea of what may be wrong with the compilation in 3.1 version ?
'till now I was able to track the problems through the error messages but without these I'm a bit stucked.

I've even cleaned the Flexviewer (3.1) project, reinstalled a fresh uncompiled basis from esri, added a new folder, new flex module and retyped the basic test code. Still the same : correct opening of the widget with right layout but then, nothing, not even the basic automations that don't require specific coding.

If I copy paste this module in the 3.0 project and compile it, it works like a charm ... :confused:

Sorry to bother you with such a problem but the urge to switch our existing widgets to the 3.1 Viewer for Flex is weighting on my back.

Thanks for the help, have a nice day !
Pierre
0 Kudos
AaronPerry
Occasional Contributor
Maybe your problem is related to:
* The "JSON" class has been renamed "JSONUtil". This was done because Flash Player 11 introduced a native JSON class.

To upgrade your code from version 2.x to 3.x, please see
http://resources.arcgis.com/en/help/flex-api/concepts/index.html#/Migrating_from_2_5_to_3_0/017p0000...


Thanks Bjorn.  I just set up FlashDevelop 4.3.0 with the 4.6 flex sdk, copied in the flex api and samples, and started trying to build the flex api samples from the api reference.  I kept getting ReferenceError: Error #1065: Variable JSON is not defined when I tried to build my project.  I found your post and changing the required player to 11.1 solved my problem.  I can now build in FlashDevelop.  Thanks again for this post!

Respectfully,
Aaron
0 Kudos