Select to view content in your preferred language

build flex viewer3.0 source code to .swc file

881
4
05-16-2012 10:42 PM
lilu1
by
Emerging Contributor
i get flex viewer2.5 source code, create a flex Library project named "xxx" in flashBuilder4.6,
copy the flex viewer3.0 source code files to the project "xxx", and add swc file refrence to "agslib-2.5-2011-11-30.swc',
then building is ok, generate a file "xxx.swc".
     create a flex Application project named "MyApp", it  add project refrence to "xxx",  building is ok,  but throw a exception while runing the "MyApp", the exception information is "null refrence ".  excepiton locate Flex viewer2.5 source file "MapManager.mxml" . why "styleManager.getStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindow")" return value is null????

     protected override function partAdded(partName:String, instance:Object):void
            {
                super.partAdded(partName, instance);
                if (instance === map)    
                {
                    var cssStyleDeclaration:CSSStyleDeclaration = styleManager.getStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindow")
                    cssStyleDeclaration.setStyle("backgroundColor", getStyle('contentBackgroundColor'));
                    styleManager.setStyleDeclaration("com.esri.ags.components.supportClasses.InfoWindow", cssStyleDeclaration, true);
                }
            }
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
li lu,

   Your workflow is pretty odd... You are liekly running into an issue with reusing the same project workspace and that there are still old version of 2.5 stuff hangin around in the bin-debug forlder. If you are going to stick to this workflow you might want to delete the contents (not the whole folder) of the bin-debug and bin-release (if on exists) and do a "clean" from the project menu in Flash Builder. But better yet just follow the instructions in the readme.txt of the Flex Viewer 3.0 Pre Release Zip file you downloaded.

============================
Getting Started - Developers
============================

See http://links.esri.com/flexviewer-gettingstarted-developers

1. In Flash Builder 4.5, Go to File Menu -> Import -> Flash Builder project.

2. Keeping "File" option selected, click "Browse..." button.

3. Select flexviewer-3.0Prerelease-src.zip downloaded in step 1, e.g. "C:\Documents and Settings\jack\My Documents\flexviewer-3.0Prerelease-src.zip".

4. "Extract new project to:" textbox will be automatically set to location where the project source will reside,
    e.g. "C:\Documents and Settings\jack\Adobe Flash Builder 4\FlexViewer.
    Do not put it onto your web server - you should separate your code location from your output.

5. Click "Finish" button. Project will be created and displayed in the Package Explorer window of Flash Builder 4, e.g. in this case FlexViewer.

0 Kudos
lilu1
by
Emerging Contributor
i want to build the flexViewer2.5 source code to a ".swc" files, other my projects can refence to it.  all build is ok. but debug is exception
[ATTACH=CONFIG]14413[/ATTACH]
0 Kudos
lilu1
by
Emerging Contributor
set the agslib-2.5-2011-11-30.swc into External-Library-Path , is ok. but throw a new exception

ReferenceError: Error #1065: Variable "com.esri.ags::FeatureSet" undefine�??
 at _Main_FlexInit$/init()
 at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()
 at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()
 at flash.events::EventDispatcher/dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at mx.preloaders::Preloader/timerHandler()
 at flash.utils::Timer/_timerDispatch()
 at flash.utils::Timer/tick()
0 Kudos
lilu1
by
Emerging Contributor
set the agslib-2.5-2011-11-30.swc into External-Library-Path , is ok. but throw a new exception

ReferenceError: Error #1065: Variable "com.esri.ags::FeatureSet" undefine�??
 at _Main_FlexInit$/init()
 at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()
 at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()
 at flash.events::EventDispatcher/dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at mx.preloaders::Preloader/timerHandler()
 at flash.utils::Timer/_timerDispatch()
 at flash.utils::Timer/tick()


additional remarks, run this code, throw exception [ATTACH=CONFIG]14475[/ATTACH]
0 Kudos