Add an event listener to trigger the display of gift details

Next you will add an event listener to the products_dg DataGrid instance to display information about each product. When the user clicks a product in the Gift Ideas section, a pop-up window appears with information about the product.

This code creates a new event listener called dgListener, and creates instances of the Window component you added to the library earlier. The title for the new window is set to the product's name. The content path for the window is set to the ProductForm movie clip. The size of the window is set to 340 x 210 pixels.

The code also adds a close button to enable the user to close the window after viewing the information.