[Mapserver-users] Mapserver and flash
Geoffrey Rowland
geoffrey.rowland at noaa.gov
Thu Aug 21 12:31:10 PDT 2003
Okay, Thanks, I have made the function ElementSelected and can get the
LayerID,ShapeID, and Event.
But I'm still at a loss how to get the SWFDUMPATTRIBUTES then? lets say
my attribute is called Name. how do I get the value using ActionScript?
Here is what I have so far (just doing this as a test)
onClipEvent (load) {
loadMovieNum("state_layer_0.swf",1);
}
onClipEvent(mouseDown) {
_level1.ElementSelected = function(lid,sid,ev){
trace("The Layer id is : " + lid);
trace("The Shape id is : " + sid);
trace("The event was : " + ev);
}
_level1.ElementSelected(LayerId,ShapeId,Event, Name)
}
Thanks,
Geoff
Yewondwossen Assefa wrote:
> The way to do it is to use at a layer level a metadata called
> SWFDUMPATTRIBUTES. The value used for this metadata are the names of
> the attributes you want to export to the swf file. Please refer to
> section "How to configure the map file to export attributes" and
> "Events and Highlights" in the document
> http://www2.dmsolutions.ca/mapserver/dl/FlashMapserverUserDoc.html
>
> Once the attributes are exported to the swf file, when the user
> clicks on these objects, there is a mouse event which is triggered and
> makes an Action Script call to: _root.ElementSelecetd(LayerId,
> ShapeId, Event). The Flash application who want to receive these
> events should define the function ElementSelected and use the
> information receive to do actions like retrieving the attribute values
> from the specific SWF for the specified shape and display it.
>
>
> Later,
>
> Geoffrey Rowland wrote:
>
>> I was playing around with this a bit the other day. Is there a way
>> to identify features in the swf file? for example if I am displaying
>> a county layer (from a shapefile), and I want to get the names of the
>> counties....is that possible using the swf output?
>>
>> Thanks,
>> Geoff
>>
>>
>> William A. Bronsema, C.E.T. wrote:
>>
>>> Lars-Göran,
>>>
>>> It is fairly easy to view the SWF output using actionscript. Set
>>> the outputformat in the map file to the following:
>>>
>>> OUTPUTFORMAT
>>> NAME swf
>>> MIMETYPE "application/x-shockwave-flash"
>>> DRIVER swf
>>> IMAGEMODE PC256
>>>
>>> # the following line is used to output all layers in one swf
>>> FORMATOPTION "OUTPUT_MOVIE=SINGLE"
>>>
>>> # the following line is used to output all layers individually
>>> #FORMATOPTION "OUTPUT_MOVIE=MULTIPLE"
>>> END
>>>
>>>
>>> After mapserver has generated the temp swf file(s) you can use the
>>> "loadMovie" actionscript function to load the swf file into a
>>> pre-existing container. For example, create a new swf file with a
>>> movie clip called "clip1" and add the following line in actionscript:
>>>
>>> loadMovie ( "http://url/to/swf/mymap.swf", "clip1" );
>>>
>>> I use PHP and php_mapscript to help manage the files on the fly and
>>> Flash to manage my actionscript.
>>>
>>> I hope this quick overview helps.
>>>
>>> Regards,
>>> Bill
>>>
>>> Lars-goran Edholm wrote:
>>>
>>>> Hi!
>>>> Does anybody have an example of using Mapserver with swf vector
>>>> output.
>>>> How do i use the swf-actionscript file to view the layers?
>>>>
>>>>
>>>> Mvh
>>>> Lars-Göran Edholm tel 026/24 14 36
>>>> 1:e byggnadsinspektör
>>>> Bygg- och miljökontoret
>>>> 811 80 Sandviken
>>>> lars-goran.edholm at sandviken.se
>>>>
>>>>
>>>> _______________________________________________
>>>> Mapserver-users mailing list
>>>> Mapserver-users at lists.gis.umn.edu
>>>> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>>>>
>>>
>>>
>>
>
>
--
Geoffrey Rowland
Technical Officer
Climate Information Project
NOAA Research
Office of Global Programs
http://www.cip.ogp.noaa.gov
Contractor,
RGII Technologies, Inc., a Computer Horizons Company
http://www.rg2.com
Phone: 301-427-2089x186
Fax : 301-427-2082
geoffrey.rowland at noaa.gov
More information about the MapServer-users
mailing list