2 Replies Latest reply on Feb 19, 2010 6:06 AM by saadi khan

    How to send xml to javascript from flex?

    saadi khan Level 1

      I am using Flex Builder......I read blogs and wonderful tutorials on adobe website. But I found that I can only have data from Flex to script placed within main.template.html file.....when i tried to get same data by in my other .html or .aspx page, it did not work. Another thing I noticed in following tutorial
      http://blog.flexexamples.com/2008/03/09/calling-javascript-functions-from-your-flex-applic ations-using-the-externalinterface-api/
      is that we placed <iframe> in our html page to host flex object instead of using <object> tag etc.

      Please just let me know how to do very same thing as defined in tutorial but by hosting out flex object using <object><embed> tags etc and how to get data into our .html or .aspx page rather putting javascript (to receive data) in main.template.html file generated by Flex Builder...???

        • 1. Re: How to send xml to javascript from flex?
          saisri2k2 Level 4

          You will be doing the same thing if you are using the <embed> tab for the flex app.


          just copy the javascript code  in the example and use it in your app (without changing anything else).


          if you want to get the xml from the .html created by flex into your .aspx or .html


          -do a post (from the javascript after you get the xml from the flex- search in google if you dont know). in action set the .aspx page as the destination and the parameters would be ofcoz the xml file.

          • 2. Re: How to send xml to javascript from flex?
            saadi khan Level 1

            Thanks for replying,

            Now I am facing another problem....I have added a script tag in index.template.html file that also contains other useful code used in my aspx page. I wanted to have that reply on my aspx page. So I placed all the script in a Core.js file and also the recieving method from flex in same Core.js file. I thought this way i will be able to access data coming from flex project to my aspx page. But something strange is happening, when i run .html file in bin-debug folder it fires receiving method placed in Core.js........but when I host that flex project .html file in my aspx page, it is not firing method. And also not firing when I run .html in bin-release folder....what am I doing wrong?