Flex ExternalInterface

Tagged Under :

In one of my recent projects, I had the requirement to open a browser window from within Flex on click of a button. Thats when I came across this Externalinterface call. Here is how I did it.

Dont forget to do this though :-

Might be useful to some of you trying to achieve the same in your project.

Comments:

8 Responses to “Flex ExternalInterface”


  1. Thats actually nice trick. It will be much more useful for communicationg with JavaScript directly - you can do browser programming from inside Flex.
    You can for example parse location, place divs, add or remove DOM nodes.
    I think you just forgot to mention the most important part is this:

    …call(”w_ = function() {…

    as it triggers JS function execution. And you can’t place var before w_ at it will not work at all.


  2. yes I agree to that. A whole lot of things can be done in terms of communicating with javascript and browser. placing a var before w_ will make it not work because then it will be treated as a flex variable? is that what you wanted to say?


  3. No - I have no idea why it won’t work with var but it doesn’t :)


  4. nice :)


  5. I assume that FABridge will be popular once it’s outta beta status? This is something you would use with it, rather than ExternalInterface?


  6. I havent got my hands dirty yet with the FABridge but from the looks of it, it looks like an interesting library. Thanks for letting me know, I am gonna try some of the examples out there.


  7. Great! I’ll be awaiting your posts on it! I haven’t played with it much do to not developing in Flex yet, but from what I heard about it at MAX 2007… it sounded like it could be quite useful.


  8. Sure Amy, I am gonna try it over the next couple days and will post it here once I do that.

Leave a Reply