14 Replies Latest reply on Nov 18, 2011 4:58 AM by JasonHanson

    Relative URL path for using Spellcheck

    Purnima Jain



      In my application, i need to prefix a token to make relative path - an absolute path. And so the problem is that the dictionaries fail to load as the XMl file "AdobeSpellingConfig.xml" has path relative to the main application swf file.


      The path will change per user and thus I can't even hard code it. Is there any way to accomplish this ? i.e i add a relative path and token and while loading it combines both to load the file?


      Can I have access to source code? Is this open source?


      All help is deeply appreciated.

        • 1. Re: Relative URL path for using Spellcheck
          je2bi Level 1

          I have the same problem.

          The best should be to be able to set the content of the AdobeSpellingConfig.xml

          • 2. Re: Relative URL path for using Spellcheck
            utsav_adobe Level 1



            Could you let us know which squiggly build are you using?


            For changing the spelling configuration URL Config XML file from default 'AdobeSpellingConfig.xml' you may set SpellUI spellingConfigURL property and use different XML file. This (spellingConfigURL) can be set using relative as well as absolute path.


            Also the 'AdobeSpellingConfig.xml' is made by you so you can always edit it and add both relative and absolute paths for Rule and Dictionary files.


            Please Let me know if this helps and please explain the problem furthur if it still exists.




            • 3. Re: Relative URL path for using Spellcheck
              Purnima Jain Level 1

              I am using squiggly_p4_092410.


              The problem I am facng is that in my application, the absolute path is determined at run time and at that point I can't rewrite the config XML file.


              Is it possible to send the absolute path as token/prefix and them append config.cml file name to make a complete path?

              For example, lets say file is placed at C:\Spellcheckapplication\myconfig.xml. So i send C:\Spellcheckapplication as prefix and then append the file name.

              So in this case when I have to access dictionary, the path can be converted to absolute path accordingly.


              Can I have access to the source code? Is this opensource project?

              • 4. Re: Relative URL path for using Spellcheck
                utsav_adobe Level 1



                What I get from your explanation is something like this

                1) Suppose You have 2 users (Myuser1 and Myuser2)

                2) You want to use 2 different (Say Myuser1.xml and Myuser2.xml) files for the users.

                3) Both files are located in C:/SpellCheckApplication/ directory.


                You can easily do this using spellingConfigURL property.


                Some code:


                <?xml version="1.0" encoding="utf-8"?>
                <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" >       
                            import com.adobe.linguistics.spelling.SpellUI;   
                            private function enableFeature():void {
                                var str1:String="C:/SpellCheckApplication/";
                                SpellUI.spellingConfigURL =str1+ta.text;
                                SpellUI.enableSpelling(textArea, "en_US");
                            private function disableFeature() :void {
                    <mx:TextArea id="textArea" width="20%" height="20%" fontSize="30" text="Mary had a lillltttlleee lambbb. His fur is wheeti as snow. "/>
                    <mx:TextArea id="ta"/>
                    <mx:Text id="result" />
                    <mx:Button id="tt1" label="disable Feature" click="disableFeature()" />
                    <mx:Button id="tt2" label="enable Feature" click="enableFeature()" />


                Now to use above you need to fill text Area 2 with either Myuser1.xml or Myuser2.xml and click enable spelling.


                Hope this helps!!



                • 5. Re: Relative URL path for using Spellcheck
                  Purnima Jain Level 1

                  Hi Utsav


                  Not just the config XMl file, I need to call rule file and dictionaryFile also in similar way i.e by giving the absolute path. I know this is peculair bu tthis is the way I have to do. And I can't edit XML at runtime because the moment I launch the application, all files associated with it will become read only.


                  So either I have a way to append path for all the files i need to access at runtime OR Can I embedd thiese files and then use them?

                  Let me know if anyone of these is possible.


                  Thanks for all your help

                  • 6. Re: Relative URL path for using Spellcheck
                    utsav_adobe Level 1


                    With the build you are using you wont be able to configure the rule and dictionary file but you would be able to this very soon with squiggly's next release.




                    • 7. Re: Relative URL path for using Spellcheck
                      Saagar Shetty

                      Hi Utsav,


                      Even i am facing this issue. I would like to know if there is any way in which i can mention the dictionary URL relative to the position of AdobeSpellingConfig.xml. In my application there are modules which are loaded. So the URL on the browser and from which the SWF is loaded are different. By passing valid value for SpellUI.spellingConfigUrl i am able to load the AdobeSpellingConfig.xml. But loading of .dic files and .aff files are failing as they are being laoded from URL relative to browser url.


                      Any inputs on this will be highly appreciated.



                      Saagar Shetty

                      • 8. Re: Relative URL path for using Spellcheck
                        utsav_adobe Level 1


                        I dont know the build you are using, but assuming that you also are using squiggly 0.4, you can always specify an absoulte path in 'AdobeSpellingConfig.xml'

                        Maybe you may edit the .xml file to set URL for Dictionary and rule file  at run time. But you cannot specify the ruleFile and dictionaryFile still in 0.4 build. Wait for the next release and you shall be able to do so.


                        Hope this answers!




                        • 9. Re: Relative URL path for using Spellcheck
                          Purnima Jain Level 1

                          When is the next release planned?

                          Can I get early preview of the build?

                          • 10. Re: Relative URL path for using Spellcheck
                            utsav_adobe Level 1

                            We are hopeful of releasing it within a month.




                            • 11. Re: Relative URL path for using Spellcheck
                              Purnima Jain Level 1

                              I could see the new build posted for spell check. But the documentation is not updated.


                              Can anyone help with how can i user relative path for dictionary and other config files it uses at run time?


                              Can I embedd all the files and refer to them later instead of keeping them seperate folder?

                              • 12. Re: Relative URL path for using Spellcheck
                                ravi_adobe_ Level 1

                                Please use this alternate location for downloading the latest asdocs: http://labs.adobe.com/downloads/squiggly.html


                                We will be correcting the main page link soon.

                                • 13. Re: Relative URL path for using Spellcheck
                                  beimon Level 1


                                  I apologize for the older content.  All links for the ASDocs on Labs should point to the latest version.


                                  - Bruce, Adobe


                                  • 14. Re: Relative URL path for using Spellcheck
                                    JasonHanson Level 1


                                    This question remains unanswerd. How do I specifiy the DYNAMIC location of the ruleFile and dictionaryFile?  When my application is running in production, depending on the server, loadballancer, etc the static location of the en_US.aff and en_US.dic DYNAMICALLY changes. Every time the app load the assets could be in a different location.  That location is passsed in a config var as a FlashVar.  I need to change the URL of the en_US.aff and en_US.dic locations at runtime.


                                    I did not see a way to do this in the documentation.  Has anyone gotten this to work?


                                    Thanks for any help you can offer.