links in flex
Unfortunately, the chaos of my job in addition to the amount of work I have to do for this assignment has prevented me from blogging anything at all. But now that I've come to a logical break point, it's probably a good time to note some of the issues I've been having with my final project...
Last weekend, I spent half a day trying to add external links to my Flex application! It was so frustrating because something that ordinarily takes me a second in HTML was causing me so much grief in ActionScript/MXML. I eventually came across this article on the Web, Listening for the link event in a Flex Label control, but even so, I felt that this method was overkill for something so simple. According to this code, I would have to create individual functions to handle each link in my application. NOT HAPPY JAN. So I went through the Flex documentation from Adobe more thoroughly until I discovered navigateToURL(). This allowed me to generate my links dynamically and pass them into this method for a more elegant way to launch external links. Easy!
Below is the way I've implemented this in my application:
<mx:LinkButton label="Buy Tickets" click="navigateToURL(new URLRequest(eventDataGrid.selectedItem.ticketlink));"/>
0 comments:
Post a Comment