We need to be able to have a LinkElement that shows a pop up (TitleWindow) when clicked. Before Flex 4.5 came out, we were using our own modified TLF build, which added support for this (among other things) by doing the following:
However, having our own TLF was causing more headaches than it was worth (mainly trying to cast things as ISWFContext when embeding fonts).
Since the TLF version included in Flex 4.5 has most of what we need, we scraped our internalized version and just went with the stock build. However, I still need to be able to support the functionality described above.
What would be the best way to implement this kind of functionality? Should we just create a new element type that provides the desired functionality? Can this be done without having to internalize the entire framework?
Any advice or links to relevent reading material would be greatly appriciated.
Thanks for your time!
Try the "event:" syntax
Yes but how would I attribute the pop up class to the event? That would only work if I knew what goes after the event:, which I don't. The popup content is defined at runtime, hence the class.
Am I mistaken in how the event: syntax works?
By using user styles.
<a href="event:popup" popupClass="somePopupClass">FOO</a>
Add a listener for the popup event to TextFlow. The event will tell you which linkElement was clicked on and you can use the getUserStyle API to access the value of popupClass.
Hmm, I guess this method wouldn't work with pre-compiled content via MXML. It looks like I might have to give creating a custom element a try instead. The first time I tried this didn't end so well, but that was some time ago. I'll give it another whirl and see how it goes.
Thanks again for the help!