flexviewer dispatchEvent message from a new widget

533
6
Jump to solution
04-06-2012 12:59 PM
AngieGarcia1
New Contributor III
I was creating a new widget from sample code in the gallery and when I created my widget I got a 3606 'dispatchEvent' has been deprecated. Please use 'appEvent.dispatch'.

I am using the new flexviewer 3.0 and the code might have been from 2.5.  In addition, I am working in flash builder 4.6.

Does anyone know what this warning means?
I have searched ESRIc site and looked at the API Reference.  I have attached the warning message

Thanks
Angie
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Angie,

   Can you show me what you had to change...? What I posted should have worked without any change.

The place to find this type of info is here is the Flex Viewer Developer documentation:

http://help.arcgis.com/en/webapps/flexviewer/apiref/index.html

You would have found the announcement about the change back in 2.4 release what's new.

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/What_was_new_in_2_4_Viewer/01m30000003...

You will have better luck getting answers if you follow a little forum etiquette.

  1. Mark your posted as answered when your original question is answered. I have posted at the bottom of my thread a image with the steps of how to do that, (again).

  2. If you have additional questions post new threads for each question once your original question has been answered.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Angie,

   It is pretty straight forward to fix this error.

Old code line
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady));


New code Line
AppEvent.dispatch(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady);


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Angie,

  Also another little thing... This is the Flex API forum and you are posting Flex Viewer questions here which should be posted on the Flex Viewer forum here:

http://forums.arcgis.com/forums/111-ArcGIS-Viewer-for-Flex

Please make not of this.
0 Kudos
AngieGarcia1
New Contributor III
Angie,

   It is pretty straight forward to fix this error.

Old code line
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady));


New code Line
AppEvent.dispatch(AppEvent.DATA_CREATE_INFOWIDGET, data, infoReady);


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:


This may have been simple code however, it did not work until I did some parentheses clean-up.  Where can one go to understand how the flex viewer syntax (code) works. I have been through ESRIs flex viewer site and the reference tags, but could not find anything on the AppEvent.dispatch.

What I want to do next is add a feature to the drop-down box ex: police station and when the point is placed on the map the line draws to the nearest police station.  As the widget stands now, one can select police station from the drop down box and place the point on the map, but no line is drawn a message just appears saying its complete.

Suggestions?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Angie,

   Can you show me what you had to change...? What I posted should have worked without any change.

The place to find this type of info is here is the Flex Viewer Developer documentation:

http://help.arcgis.com/en/webapps/flexviewer/apiref/index.html

You would have found the announcement about the change back in 2.4 release what's new.

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/What_was_new_in_2_4_Viewer/01m30000003...

You will have better luck getting answers if you follow a little forum etiquette.

  1. Mark your posted as answered when your original question is answered. I have posted at the bottom of my thread a image with the steps of how to do that, (again).

  2. If you have additional questions post new threads for each question once your original question has been answered.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
0 Kudos
AngieGarcia1
New Contributor III
Angie,

   Can you show me what you had to change...? What I posted should have worked without any change.

The place to find this type of info is here is the Flex Viewer Developer documentation:

http://help.arcgis.com/en/webapps/flexviewer/apiref/index.html

You would have found the announcement about the change back in 2.4 release what's new.

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/What_was_new_in_2_4_Viewer/01m30000003...

You will have better luck getting answers if you follow a little forum etiquette.

  1. Mark your posted as answered when your original question is answered. I have posted at the bottom of my thread a image with the steps of how to do that, (again).

  2. If you have additional questions post new threads for each question once your original question has been answered.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:


Thanks for the update
Angie
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Angie,

   If you do not add the GeometryEffects.swc from the swc folder to your projects libs folder than you will probably not get the lines drawn to the closest facilities.
0 Kudos