This is not an easy task, I have attempted to do this in the past with no luck. You need to look at the API's for help. The JavaScript API would probably be the easiest and it is free (where as the Flex API requires Adobe Flex and the Silverlight API requires Microsoft Silverlight). Here is a link to the concept page of the JavaScript API http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm. If you navigate to 'Inside the API' and then down to "Popups and Info Windows" it gives you code examples of the different types of things you can add to a pop-up. If you couple that with the "Using the RouteTask" examples you may be able to do it. This requires a geoprocessing task and there is a sample ArcGIS server that you can use but it will max out the number of directions given (I think around a million a month).
On the "Samples" tab at the top of the API page you will get full code for some examples. Here you want to look at the "Find and Identify" examples for the pop-ups and the "Network Analyst" for the directions.
You will need to host this on your own web server. There is code to have it reference your ArcGIS Online Maps. You can use the sample GIS server for the directions task depending on your use,free for personal I believe. If you have an ArcGIS Server than you can create your own geoproccessing task for directions (if you have the network analyst extension).
This is not an easy task, I have attempted to do this in the past with no luck. You need to look at the API's for help. The JavaScript API would probably be the easiest and it is free (where as the Flex API requires Adobe Flex and the Silverlight API requires Microsoft Silverlight). Here is a link to the concept page of the JavaScript API http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm. If you navigate to 'Inside the API' and then down to "Popups and Info Windows" it gives you code examples of the different types of things you can add to a pop-up. If you couple that with the "Using the RouteTask" examples you may be able to do it. This requires a geoprocessing task and there is a sample ArcGIS server that you can use but it will max out the number of directions given (I think around a million a month).
On the "Samples" tab at the top of the API page you will get full code for some examples. Here you want to look at the "Find and Identify" examples for the pop-ups and the "Network Analyst" for the directions.
You will need to host this on your own web server. There is code to have it reference your ArcGIS Online Maps. You can use the sample GIS server for the directions task depending on your use,free for personal I believe. If you have an ArcGIS Server than you can create your own geoproccessing task for directions (if you have the network analyst extension).