10 Replies Latest reply on Jan 3, 2009 12:06 AM by ntsiii

    html to flex


      I have one html file.I need to make it as mxml file.Anybody will you please tell me how can i do this?
      Here am posting the code also.


      <script type="text/javascript" src=" http://www.plaxo.com/css/m/js/util.js"></script>
      <script type="text/javascript" src=" http://www.plaxo.com/css/m/js/basic.js"></script>
      <script type="text/javascript" src=" http://www.plaxo.com/css/m/js/abc_launcher.js"></script>
      <script type="text/javascript"><!--
      function onABCommComplete(data) {
      // OPTIONAL: do something here after the new data has been populated in your text area
      <textarea rows="5" cols="50" id="recipient_list" name="recipients"></textarea>
      <a href="#" onclick="showPlaxoABChooser('textareas', '/Simple/info/abc.html'); return false">
      <img src=" http://www.plaxo.com/images/abc/buttons/add_button.gif" alt="Add from my address book" />

      Best Regards
        • 1. Re: html to flex
          ntsiii Level 3
          You will need to write the mxml code.

          There are no automatic translation options that I know of.

          • 2. Re: html to flex
            BharathEnaganti Level 1
            hey sorry my intention also same.I am sorry may be my question is wrong.
            How to write proper mxml code for the above html code.I am getting errors.

            • 3. Re: html to flex
              ntsiii Level 3
              What errors? Post the code that is erroring, indicate which line. Use the "attach code" button in the main reply window to show the code.

              We can't suggest a solution until we see the problem.

              • 4. Re: html to flex
                BharathEnaganti Level 1
                errors are
                Return value must be undefined
                Call to a possibly undefined method showPlaxoABChooser

                Hope you know that location of index.template.html file.due to large content of this file i've posted only required code.If you want i'll post complete code of this file.That single htm file to make it as mxml file i've made it like this.I don't know how to include js files in mxml code.due to that i've included those in index.template.html file.May be that that's why only it's saying undefined method.

                • 5. Re: html to flex
                  BharathEnaganti Level 1
                  sorry forgotten to indicate line number
                  at line number 8 in MyContacts.mxml i am getting those two errors.

                  • 6. Re: html to flex
                    Alce Alvarez
                    Hi Shailu.

                    When your button is clicked, it's trying to invoke the ActionScript function showPlaxoABChooser() (which is not defined), not the JavaScript function of the same name.

                    Try something like this:

                    • 7. html to flex
                      BharathEnaganti Level 1
                      ok...but you missed one morething here
                      <mx:Button label="Import" click="showPlaxoABChooser('recipient_list', 'Simple/info/abc.html');return false"/>

                      instead of this i'll change like this

                      ExternalInterface.call("showPlaxoABChooser", "recipient_list", "Simple/info/abc.html");

                      ok where can i specify that "return false" ???

                      That's the major thing am thinking about where to keep....???


                      • 8. Re: html to flex
                        ntsiii Level 3
                        You are not clear on what you are trying to do.

                        Are you replacing the html page entirely, or attempting to invoke javascript function in the wrapper from Flex?

                        What is the purpose of "return false"? What are you expecting to happen? What are you returning the "false" to? That line was causing the error in your posted code because you were trying to make a mx:Button return a "false", but mx:Button component does not support return values.

                        • 9. Re: html to flex
                          BharathEnaganti Level 1
                          sorry ,

                          I want to replace that html file with mxml file.

                          • 10. Re: html to flex
                            ntsiii Level 3
                            You understand that the html file includes those three javascript includes, so you must implement their functionality in Flex/AS as well? At least that functionality you need to use in Flex.

                            Or, if it makes sense, you can invoke javascript functions in the wrapper from Flex. But you just said you don't want to do that, right?

                            You should probably start over and tell us what you want to accomplish functionally.