Writing an onClipEvent as a function

Hi all,
I'm currently using this to scale different symbols in
various parts of my movie:
onClipEvent(enterFrame) {
speed = .3;
this._xscale += speed;
this._yscale += speed;
As I'm attaching that directly to the movie clip instances
it's obviously not very efficient to edit. How can I write this
once as a function so that I can simply call it each time I want to
use it?
I've written simple functions before but for some reason this
has thrown me. Any help appreciated.
cheers,
Ponch

However, if we declare an array of integers like this,
it will yield compile error:
int [] a = new int {1,2,3}; //compile errorit's wrong. should be
int [] a = new int [] {1,2,3};

Similar Messages

  • Writing the results of JavaScript function to a table.

    Hi - I used the javascript from the post below to calculate a field based on two other fields. It works fine, but is only displaying it - not assigning it to the page item.
    How can I assign the result to a page item so that it is processed with the auto DML when the page is submitted?
    Thanks,
    Matt
    Re: How to multiply two textbox values and write it to another textbox?
    function addthis(){
    var val1 = parseInt($v('PX_VALUE1'));
    var val2 = parseInt($v('PX_VALUE2'));
    if ($v('PX_VALUE1') != "" && $v('PX_VALUE2') != ""){
    var answer = val1+val2
    $s('PX_VALUE3',answer);
    }

    What kind of item is PX_VALUE3 - a text item or a display item or something else?
    What happens if you manualy change the value of PX_VALUE3 to something? Does the DML Process save that value or not?
    What is the source used and source type of your PX_VALUE3 item - is it only when... or always... / is it a database column or static assignment?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to create a function with dynamic sql or any better way to achieve this?

            Hello,
            I have created below SQL query which works fine however when scalar function created ,it
            throws an error "Only functions and extended stored procedures can be executed from within a
            function.". In below code First cursor reads all client database names and second cursor
            reads client locations.
                      DECLARE @clientLocation nvarchar(100),@locationClientPath nvarchar(Max);
                      DECLARE @ItemID int;
                      SET @locationClientPath = char(0);
                      SET @ItemID = 67480;
       --building dynamic sql to replace database name at runtime
             DECLARE @strSQL nvarchar(Max);
             DECLARE @DatabaseName nvarchar(100);
             DECLARE @localClientPath nvarchar(MAX) ;
                      Declare databaselist_cursor Cursor for select [DBName] from [DataBase].[dbo].
                      [tblOrganization] 
                      OPEN databaselist_cursor
                      FETCH NEXT FROM databaselist_cursor INTO @DatabaseName
                      WHILE @@FETCH_STATUS = 0
                      BEGIN       
       PRINT 'Processing DATABASE: ' + @DatabaseName;
        SET @strSQL = 'DECLARE organizationlist_cursor CURSOR
        FOR SELECT '+ @DatabaseName +'.[dbo].[usGetLocationPathByRID]
                                   ([LocationRID]) 
        FROM '+ @DatabaseName +'.[dbo].[tblItemLocationDetailOrg] where
                                   ItemId = '+ cast(@ItemID as nvarchar(20))  ;
         EXEC sp_executesql @strSQL;
        -- Open the cursor
        OPEN organizationlist_cursor
        SET @localClientPath = '';
        -- go through each Location path and return the 
         FETCH NEXT FROM organizationlist_cursor into @clientLocation
         WHILE @@FETCH_STATUS = 0
          BEGIN
           SELECT @localClientPath =  @clientLocation; 
           SELECT @locationClientPath =
    @locationClientPath + @clientLocation + ','
           FETCH NEXT FROM organizationlist_cursor INTO
    @clientLocation
          END
           PRINT 'current databse client location'+  @localClientPath;
         -- Close the Cursor
         CLOSE organizationlist_cursor;
         DEALLOCATE organizationlist_cursor;
         FETCH NEXT FROM databaselist_cursor INTO @DatabaseName
                    END
                    CLOSE databaselist_cursor;
                    DEALLOCATE databaselist_cursor;
                    -- Trim the last comma from the string
                   SELECT @locationClientPath = SUBSTRING(@locationClientPath,1,LEN(@locationClientPath)-  1);
                     PRINT @locationClientPath;
            I would like to create above query in function so that return value would be used in 
            another query select statement and I am using SQL 2005.
            I would like to know if there is a way to make this work as a function or any better way
            to  achieve this?
            Thanks,

    This very simple: We cannot use dynamic SQL from used-defined functions written in T-SQL. This is because you are not permitted do anything in a UDF that could change the database state (as the UDF may be invoked as part of a query). Since you can
    do anything from dynamic SQL, including updates, it is obvious why dynamic SQL is not permitted as per the microsoft..
    In SQL 2005 and later, we could implement your function as a CLR function. Recall that all data access from the CLR is dynamic SQL. (here you are safe-guarded, so that if you perform an update operation from your function, you will get caught.) A word of warning
    though: data access from scalar UDFs can often give performance problems and its not recommended too..
    Raju Rasagounder Sr MSSQL DBA
          Hi Raju,
           Can you help me writing CLR for my above function? I am newbie to SQL CLR programming.
           Thanks in advance!
           Satya
              

  • Adapter Module Vs Function Module

    We are creating a Adapter Module to process an Incoming File. The File contains the Material Master data. But there are many records are invalid due to various reasons. We need to strip the badrecords.
    There are around 650 fields in each record and the condition are very complex to be validated in the XI message mapping. Thats were we decided to go with an Adapter Module.
    But my question here is, can i write a Function Module in XI and send the File to the Function Module to validate them and there by strip the bad records, rather than writing an adapter module?
    Any Suggestions

    Hi Jenni,
    I assume that, you are an ABAPer and you do not want to go for an adapter module creation. My suggession would be -
      Use the file adapter. use FCC and create the XML structure you need. Do not have any validations at this time. Just create the XML. Now you have two options -
      a. Create an ABAP mapping and pass this XML to the ABAP mapping. Implement all of you business validation rules here, and create the target structures only when everything looks good. Here you would have full control over the target message.
      b. If you are more interested in writing a FM. creating a function module (rather server synchronous proxy) then implement the logic here. The output structure of this proxy would be with all the good records. You would need to have BPM in this case.
    I beleive I made some sense.
    VJ

  • Named Parameters in Functions: Possible?

    I want to use named parameters to call PL/SQL functions using JDBC, as is best practice and necessary for default values to work. Unfortunatley all the examples I found are for procedures only. Using a positional registerOutParameter with named register / get methods on the CallableStatement does not work, obiviously.
    Is there any proper way to use named parameters with functions ? Proper does not include writing wrapper procedures nor turning functions into procedures.

    Hi Avi,
    as far as I know the return value of a PL/SQL function does not have a name, as oposed to the parameters of a PL/SQL function, which must have a name. One could argue that the return value of a function is called the same as the function itself. I have tried that option but it does not work.
    Unfortunatley the method OraclePreparedStatement.registerReturnParameter refers to something else than the return value of a PL/SQL function. Is it possible that the developers of the driver have forgotten something?

  • [b]Using Analytic functions...[/b]

    Hi All,
    I need help in writing a query using analytic functions.
    Foll is my scenario. I have a table cust_points
    CREATE TABLE cust_points
    ( cust_id varchar2(10),
    pts_dt date,
    reward_points number(3),
    bal_points number(3)
    insert into cust_points values ('ABC',01-MAY-2004',5, 15)
    insert into cust_points values ('ABC',05-MAY-2004',3, 12)
    insert into cust_points values ('ABC',09-MAY-2004',3, 9)
    insert into cust_points values ('XYZ',02-MAY-2004',8, 4)
    insert into cust_points values ('XYZ',03-MAY-2004',5, 1)
    insert into cust_points values ('JKL',10-MAY-2004',5, 11)
    I want a result set which shows for each customer, the sum of reward his/her points
    but balance points as of the last date. So for the above I should have foll results
    cust_id reward_pts bal_points
    ABC 11 9
    XYZ 13 1
    JKL 5 11
    I having tried using last_value(), for eg
    Select cust_id, sum(reward_points), last_value(bal_points) over (partition by cust_id)...but run into grouping errors.
    Can anyone help ?

    try this...
    SELECT a.pkcol,
         nvl(SUM(b.col1),0) col1,
         nvl(SUM(b.col2),0) col2,
         nvl(SUM(b.col3),0) col3
    FROM table1 a, table2 b, table3 c
    WHERE a.pkcol = b.plcol(+)
    AND a.pkcol = c.pkcol
    GROUP BY a.pkcol;
    SQL> select a.deptno,
    2 nvl((select sum(sal) from test_emp b where a.deptno = b.deptno),0) col1,
    3 nvl((select sum(comm) from test_emp b where a.deptno = b.deptno),0) col2
    4 from test_dept a;
    DEPTNO COL1 COL2
    10 12786 0
    20 13237 738
    30 11217 2415
    40 0 0
    99 0 0
    SQL> select a.deptno,
    2 nvl(sum(b.sal),0) col1,
    3 nvl(sum(b.comm),0) col2
    4 from test_dept a,test_emp b
    5 where a.deptno = b.deptno
    6 group by a.deptno;
    DEPTNO COL1 COL2
    30 11217 2415
    20 13237 738
    10 12786 0
    SQL> select a.deptno,
    2 nvl(sum(b.sal),0) col1,
    3 nvl(sum(b.comm),0) col2
    4 from test_dept a,test_emp b
    5 where a.deptno = b.deptno(+)
    6 group by a.deptno;
    DEPTNO COL1 COL2
    10 12786 0
    20 13237 738
    30 11217 2415
    40 0 0
    99 0 0
    SQL>

  • How to find Obsolete function modules ?

    Hi ,
    I am working on upgrade project R/3 4.6 to ECC 6.0 . I need to find obsolete function modules in program . I already have list of obsolete  FM .Is there any program or logic through which we can find all obsolete FM at single execution.
    Thanks & Regards
    Sandeep

    Hello Sandeep,
    I'm not sure if there's a standard report/program to list obsolete function modules, but you can manually check them in table RODIR (via SE16 transaction) - there's a flag properly called 'OBSOLETE'
    FYI, table TFDIR contains the FMs that were released.
    There are some notes which provid additional information on this topi:
    #109533: Use of SAP function modules
    #857904: Upgrade from Release 6.40 to 7.0 for customer programs
    #595310: ws_filename_get function module is obsolete
    Please be aware that those FMs are still there - all applications will have the old function modules installed for
    backwards compatibility and legacy reasons. However if you are writing your own code, these function modules will still be available, but not supported by SAP Support.
    I hope this information help you.
    Best regards,
    Tomas Black

  • Use of function called "in background task"

    Hi folks!
    In my company there are rumors that a function called "in background task" can be used to make sure that all database changes of previous statements are already persisted. This would mean that a function called "in background task" can be used to read data from database that has been written by the same report - in any case (update dispatching over several instances,...). Usually this won't be a good idea (we know well about SAPs update concepts and read everything about it on help.sap.com). Has anybody some experiences about this or is there even a guru, able to explain why it will always work (or not)? We don't have evidence that the database has finished writing for sure when the function starts - that's why I'm worried.
    Example:
    REPORT test.
    INSERT something to database.
    CALL FUNCTION function in background task.
    End of the report
    Will it always work (when testing, it does)?
    Any help will be appreciated!
    Greetings

    Hi,
    Logically it is correct. BACKGROUND TASK Triggers an asynchronous process. This FM is executed in multiple steps.
    In first step system save the data passed to FM interface to buffer. When ever program encounters Explicit/implicit commit, the source code of the FM is processed.
    Note: You can't get back the data from this FM call.
    Check the F1 help on call function statement. You will get much more details.
    Thanks,
    Vinod.

  • Pipelined function, select from table t1 or t2 depending on user's choise

    Hi all,
    My need is to select data from table t1 or t2 depending on user's choise using pipelined function. You can find my first guess below. Maybe someone can help me to save some code, I mean getting the same result without writing "PIPE ROW" twice.
    FUNCTION fn_indicators (p_datbeg date, p_datend date, p_indicatorid number) return cl_risk_act pipelined IS
    v_obj cl_user_type;
    BEGIN
    case when p_indicatorid = 1 then
    FOR e IN (
    select trunc(sysdate-1) as adate, 0 as cid, 0 as indicatorid, '0' as code, '0' as indicatorname, 0 as value, 0 as cnt, '0' as cname from dual
    LOOP
    v_obj.adate              := e.adate;
    v_obj.cid                  := e.cid;
    v_obj.indicatorid       := e.indicatorid;
    v_obj.code               := e.code;
    v_obj.indicatorname  := e.indicatorname;
    v_obj.value              := e.value;
    v_obj.cnt                 := e.cnt;
    v_obj.cname            := e.cname;
    PIPE ROW (v_obj);
    END LOOP;
    when p_indicatorid = 2 then
    FOR e IN (
    select trunc(sysdate-2) as adate, 1 as cid, 1 as indicatorid, '1' as code, '1' as indicatorname, 1 as value, 1 as cnt, '1' as cname from dual
    LOOP
    v_obj.adate              := e.adate;
    v_obj.cid                  := e.cid;
    v_obj.indicatorid       := e.indicatorid;
    v_obj.code               := e.code;
    v_obj.indicatorname  := e.indicatorname;
    v_obj.value              := e.value;
    v_obj.cnt                 := e.cnt;
    v_obj.cname            := e.cname;
    PIPE ROW (v_obj);
    END LOOP;
    end case;
    RETURN;
    end;

    marco wrote:
    Justin,
    In my real code table real_t1 or pipelinedfn_t2 is joined to other tables, so surely real code is bigger than sample one. It is not wise to keep code twise with only one table name changed. I think about dynamic sql to choose from two tables:
    with t1 as
    (select * from real_t1
    t2 as
    (select * from pipelinedfn_t2
    t3 as (
    [dynamic selection of t1 or t2 depending on user's choise]
    select * from t3, t... where...I don't know correct syntax.
    Any ideas?
    >Justin,
    In my real code table real_t1 or pipelinedfn_t2 is joined to other tables, so surely real code is bigger than sample one. It is not wise to keep code twise with only one table name changed. I think about dynamic sql to choose from two tables:
    with t1 as
    (select * from real_t1
    t2 as
    (select * from pipelinedfn_t2
    t3 as (
    [dynamic selection of t1 or t2 depending on user's choise]
    select * from t3, t... where...I don't know correct syntax.
    Any ideas?
    Dynamic code does NOT scale.
    Making the tradeoff of smaller code size for reduced performance is not one that I would make.

  • Error in executing function

    i am writing this function in which i pass the patientID which in number and this function returns the
    name of the patient i compiled this function i got compiled and message came
    Warning: execution completed with warning
    FUNCTION Compiled.
    but warning is not showing means kind of warning
    but when i call this function
    error comming
    select fn_PatientFullName(1) from dual;
    error
    ORA-06575: Package or function FN_PATIENTFULLNAME is in an invalid state
    i have searched on google i got this syntax of writing the function
    CREATE FUNCTION get_bal(acc_no IN NUMBER)
    RETURN NUMBER
    IS acc_bal NUMBER(11,2);
    BEGIN
    SELECT order_total
    INTO acc_bal
    FROM orders
    WHERE customer_id = acc_no;
    RETURN(acc_bal);
    END;
    and iam writing in the same way function is compiling with warning
    this is below
    my function
    CREATE or replace  FUNCTION fn_PatientFullName(p_PatientID in number)
    RETURN varchar2(150)
    AS
    BEGIN
    *     v_PatName varchar2(150);*
    SELECT Title_Mst.Title_Name || ' '
    *|| First_Name || ' '*
    *|| Middle_Name || ' '*
    *|| Last_Name*
    *     into v_PatName*
    FROM         Patient INNER JOIN
    Title_Mst ON Patient.Title = Title_Mst.Title_ID
    *     Where Patientid = p_PatientID;*
    Return  v_PatName;
    END;
    somebody please explain
    Edited by: user21354 on Feb 1, 2011 11:30 PM
    Edited by: user21354 on Feb 1, 2011 11:31 PM

    Assuming that all the asterixxes were added to format the code
    1) You cannot declare the length of a VARCHAR2 that is a return parameter
    2) Local variables need to be declared before the BEGIN clause
    So you'd need something like
    CREATE or replace FUNCTION fn_PatientFullName(p_PatientID in number)
      RETURN varchar2
    AS
      v_PatName varchar2(150);
    BEGIN
      SELECT Title_Mst.Title_Name || ' '
              || First_Name || ' '
              || Middle_Name || ' '
              || Last_Name
        into v_PatName
      FROM Patient INNER JOIN Title_Mst ON Patient.Title = Title_Mst.Title_ID
    Where Patientid = p_PatientID;
      Return v_PatName;
    END;Justin

  • Crystal report Connection Error

    <p>Hi,</p><p>I am writing a component whose main function is to run reports from the repository and store in pdf format at specific loaction. The problem I have got is bit wierd. out of 23 reports 7 reports work perfect but rest give me error as "CrystalDecisions.CrystalReports.Engine.InternalException: Business View error in Dynamic DataConnection. Cannot open database. Business View error in Dynamic DataConnection."</p><p>All reports works fine from Business Object Management Console.  I am not able to understand where the problem is. Autenctication is done by passing adminstrator of the repository.</p><p>Can somone guide where I amdoing wrong?</p><p>TIA</p><p>Amit</p>

    Hello Amid,
    try to get a full error with error number and enter this into our note search under :
    https://www.sdn.sap.com/irj/sdn/businessobjects-notes
    This is the new source where you should find more answers.

  • Getting Error while creating Genric Datasource

    Hi,
    I was try to create genric extracter where i was getting error
    While creating view genric extracter where i am getting error "Entry A ZV_ZFRT  does not exist in DD02L - check your entry".
    My requirement is need to create extracter which is getting populated from three modules like SD,MM,FI/CO.From these three module i am using several tables and some of the tables don't have relation btween these tables as like foreign key and refrence key.
    Which extracter i need to create as given scenario?
    Does view will fullfill with my requirement or any other extracter.
    Please some one can help me in this scenario.
    Answer would be great appreciate.

    Hi,
    Rather than writing a program write a function module. Create a structure and include all the necessary fields in the structure. Then in the function module write the logic to extract the values for those fields. While creating the datasource specify the function module and structure name.
    Refer this link:
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    Hope this helps.
    PB

  • Error Recognizing Standard VO in Jdeveloper.

    Hi All,
    I need to add tow fields at header level of a requsiition approval workflow page. I was trying to Extend a VO by getting those additional values by writing a Procedure or a function.
    While trying to extend the VO, my Jdeveloper is throwing me an error that it is unable to recognize the standard VO.
    I copied all the files from the server onto my local machine.
    After the error, when I am trying to extend the VO, the extended VO is not showing any attributes.
    VO Name : NftAttrVO
    EP Name : NftEO
    Its urgent, can anyone pls help me on this.
    Thanks in Advance
    Indra
    Error
    oracle.jbo.dt.objects.JboException: The following object(s) referred to objects that could not be found:
    xx.oracle.apps.fnd.wf.worklist.webui.NtfAttrVO
    Could not find the following referenced object(s):
    oracle.apps.fnd.wf.worklist.server.NtfEO
         at oracle.jbo.dt.objects.JboException.throwException(JboException.java:81)
         at oracle.jbo.dt.objects.JboPackage.loadResolveReferencesXML(JboPackage.java:1397)
         at oracle.jbo.dt.objects.JboPackage.finishObjectsLoad(JboPackage.java:1042)
         at oracle.jbo.dt.objects.JboPackage.loadFromXMLFile(JboPackage.java:972)
         at oracle.jbo.dt.objects.JboPackage.loadFromXMLFile(JboPackage.java:951)
         at oracle.jbo.dt.objects.JboBaseObject.loadFromXMLFile(JboBaseObject.java:2615)
         at oracle.jbo.dt.objects.JboPackage.loadFromXMLFile(JboPackage.java:880)
         at oracle.jbo.dt.objects.JboPackage.checkForLoad(JboPackage.java:451)
         at oracle.jbo.dt.jdevx.ui.appnav.APNavigatorFilter.updateDir(APNavigatorFilter.java:226)
         at oracle.ide.model.ContentLevel.applyContentLevelFilters(ContentLevel.java:809)
         at oracle.ide.model.ContentLevel.addFlatDirs(ContentLevel.java:660)
         at oracle.ide.model.ContentLevelFolder.getChildrenList(ContentLevelFolder.java:72)
         at oracle.ide.model.ContentElement.getChildren(ContentElement.java:100)
         at oracle.ideimpl.explorer.ExplorerNode.getChildNodes(ExplorerNode.java:325)
         at oracle.ideimpl.explorer.BaseTreeExplorer.addChildren(BaseTreeExplorer.java:362)
         at oracle.ideimpl.explorer.BaseTreeExplorer.open(BaseTreeExplorer.java:872)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:237)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:248)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:248)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:248)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:248)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:248)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:248)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:248)
         at oracle.ide.explorer.ExplorerContext.checkExpansionState(ExplorerContext.java:248)
         at oracle.ide.explorer.ExplorerContext.restoreExpansionState(ExplorerContext.java:196)
         at oracle.ideri.navigator.DefaultNavigatorWindow$2.run(DefaultNavigatorWindow.java:1159)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Hi,
    You should have all the files related the VO NftAttrVO like all Eo xml files, and if any view links, or asscoaictions.
    Open your VO. xml file and find all the dependencies.and take all the necessary xml,and class(Convert into java) files from the server nad put in the correct directory.
    And before extending it you should be able to open the standard vo without any errors.
    If it is a requisition workflow and header region. Cant you customize the workflow instead of OA Region. As this Vo(oracle.apps.fnd.wf.worklist.webui.NtfAttrVO) is used globally.
    if you change here it may change in other notification also.
    Thanks
    Bharat

  • Select count(*) statement in ABAP

    Hi,
    Im writing following statement in my Function module,
    select count(*) into l_count
    from user_master
    where username = l_username and
          process_type = processtype and
          password = oldpassword.
    And there is one entry in table user_master.
    But still, I'm getting l_count as zero..
    Can somebody help me with this.
    Regards,
    Amey

    select count(*) into l_count
    from user_master
    where username = l_username and
    process_type = processtype and
    password = oldpassword.
    Use group by option...
    Like this....
    select count(*) into l_count
    from user_master
    where username = l_username and
    process_type = processtype and
    password = oldpassword group by username.

  • Problem with formatting the saved text to hard disk

    I use a modified code from Macromedia for saving the content of a text filed on hard disk. See code at the end.
    The code works fine and a text file is saved in the given location on the hard disk.
    The problem is that all of the content of the text field appears in a very long single line.
    The line breaks in the text field does not appear at all in the saved text file.
    for example:
    if the following is the the content of the text filed on the stage:
    abcdef
    jhijklm
    nopqrst
    uvxwyz 
    then the saved file is like: abcdefjhijklmnopqrstuvxwyz 
    No line break happens! How can this be fixed?
    Thanks for any suggestions.
    HR
    ******************* Here is the code *************************
    --this handler saves the contents of the field into a text file called 'output.txt'
    --it over writes anything that is in the 'output.txt' file.
    global myFile
    on mouseUp
      if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
      myFile = new(xtra "fileio")    -- Create an instance of FileIO
      openFile (myFile, the moviePath &"output.txt",0)--Open the file with R/W access
      delete(myFile) --deletes the file
      createFile (myFile, the moviePath &"output.txt) --creates the file again
      openFile(myFile,the moviePath &"output.txt,0) --Open the file with R/W access
      mySaveString = member("input").text --puts the contents of the field 'input' into the variable mySaveString
      writeString(myFile,mySaveString) --writes text to the file
      closeFile(myFile) -- Close the file
      myFile = 0 -- Dispose of the instance
    end

    You need to replace the carriage returns (that aren't followed by a line feed) with the CRLF combination. Feel free to place the following JavaScript handler into a movie script and call it prior to writing your string to disk:
    function jsStringToDOS (str) {
      return str.replace(/(\x0D)(?!\x0A)/g, "\x0D\x0A");
    global myFile
    on mouseUp
      if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
      myFile = new(xtra "fileio")    -- Create an instance of FileIO
      openFile (myFile, the moviePath &"output.txt",0)--Open the file with R/W access
      delete(myFile) --deletes the file
      createFile(myFile, the moviePath &"output.txt") --creates the file again
      openFile(myFile,the moviePath &"output.txt",0) --Open the file with R/W access
      mySaveString = member("input").text --puts the contents of the field 'input' into the variable mySaveString
      mySaveString = jsStringToDOS(mySaveString) -- convert to Windows CRLF characters
      writeString(myFile,mySaveString) --writes text to the file
      closeFile(myFile) -- Close the file
      myFile = 0 -- Dispose of the instance
    end

Maybe you are looking for