How to compile the "Create WMS Layer" code

2360
2
12-09-2010 01:23 PM
sofoo
by
Occasional Contributor
Hello,

I am using the Flex SDK and mxmlc at the command prompt to compile the sample mxml code from ESRI's Flex API samples.

So far I have been able to create swfs with the mxml files just fine.  But the source code for the "Create WMS Layer" sample has an ".as" file that comes with it.  I can't figure out how I am suppose to compile this with the mxml file. 

I tried using compc to create a swc file from the .as file, but that hasn't worked.  Compc can't seem to find the DynamicMapServiceLayer class.  I tried specifying the ESRI agslib swc file as a library, but then it gave me other errors.  I'm not even sure I am suppose to be using compc?

Any help is appreciated! Thanks so much!!
Tags (2)
0 Kudos
2 Replies
sofoo
by
Occasional Contributor
Alright, I figured it out.  I don't have to create an swc file.  I just have to create a folder structure that matches the package name (com-esri-ags-samples) and then put the .as file in the samples folder.  Then, when I run mxmlc on the mxml file, it creates the swf!!  yay!

I guess the question would now be, would you ever create an swc file for an extended class?
0 Kudos
DasaPaddock
Esri Regular Contributor
The API now includes a WMSLayer so the sample serves more to show how to extend the DynamicMapServiceLayer.
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/layers/WMSLayer.html
http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=WMS

If you still want to compile it, then you would use mxmlc since that's what you need to use to build a swf. You may find the ant tasks easier to work with. Here's some links to Adobe's doc:

Flex compilers:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7ffd.html
Ant tasks:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf678b2-8000.html
0 Kudos