HOME  FORUM  LINKS

Site Menu

Development

Director

Hosting Support

Quick Links

DOMAJ DXLIB TIPS

  • How do I return a value to Director?.
  • This simple example writes the member width to the message
       window and returns the text of the member with the characters
       in reverse order.
       eg.
          a=tdFieldTest(1,1)
          member width: 249 <---- written by the xtra
          member(2).text = a

    Unit fieldTest;

    Interface

    Uses DXClasses, Windows, sysUtils;

    Type
      Tv66=Class(TDXScript)
      Protected
        Procedure ExecuteFunction(FunctionIndex:Cardinal; Const ArgList:IDXArgList;
          Const Result:IDXValue); override;
      Public
        Class Procedure GetScriptInfo(Var ScriptInfo:TDXScriptInfo); override;
        Class Procedure InitializeClass(Const Info:TDXInitializeClassInfo); override;
      End;

    Implementation

    Uses strUtils;

    Const
      CLSID_Script:TGUID='{E5F53CC1-57C0-11D6-9135-004F4900150E}';

    Var
      fieldType, fieldText, fieldWidth: TDXSymbol;

    Class Procedure Tv66.GetScriptInfo(Var ScriptInfo:TDXScriptInfo);
    Begin
      ScriptInfo.MessageTable:='xtra v66'#10+
        '* tdFieldTest castNumber integer, memberNumber integer'#10;
    End;

    Class Procedure Tv66.InitializeClass(Const Info:TDXInitializeClassInfo);
    Begin
      fieldType := info.SymbolManager.CreateSymbol('FIELD');
      fieldText := info.SymbolManager.CreateSymbol('TEXT');
      fieldWidth := info.SymbolManager.CreateSymbol('WIDTH');
    End;

    Procedure Tv66.ExecuteFunction(FunctionIndex:Cardinal;
      Const ArgList:IDXArgList; Const Result:IDXValue);
    Procedure tdFieldTest (castNumber, memberNumber : Integer);
    Var
      cast : IDXCast;
      member : IDXCastMember;
      tdValue : IDXValue;
    Begin
      cast := Movie.GetCastByIndex(castNumber);
      member := cast.CastMember[memberNumber];
      tdValue := member.GetProperty(fieldWidth);
      sendMessage('member width: '+intToStr(tdValue.Integer)+#10);
      tdValue := member.GetProperty(fieldText);
      result.Text := reverseString(tdValue.Text);
    End;
    Begin
      Case FunctionIndex Of
      0: tdFieldTest(argList[0].Integer,ArgList[1].Integer);
      End;
    End;

    Initialization
      RegisterDXClass(Tv66,CLSID_Script);
    End.


    Generated on 29APR02 by DOMAJ

    Click here to see fieldTest_pas.HTM in a separate window

    DXLIB TIPS INDEX

    1. When I use sendMessage, the message does not appear in the Director message window. Why?
    2. How do I return a value to Director?.
    3. What is the results interface?
    4. Field properties.
    5. How do I trigger the mouseUp handler?
    6. How do I add my own function to an asset?
    7. How do I add my own function to a sprite?
    8. How do I manipulate the score?
    9. How do I show delphi forms?
    10. How do I define and use my own variables?
    11. How do I create and and read global variables and their values?
    12. How do I create a behavior?
    13. How do I trigger a script in Director?
    14. How do I get the properties of a cast member?(31Mar03)
    15. How do I manipulate casts?
    16. How do I debug an XTRA?
    17. How do I draw a castmember icon?
    18. How do I add my own resource file bitmap as the castmember icon?
    19. How do I add a Director property interface
    20. Using the bitmap media property of a castmember (30Apr02)
    21. How do I return a list to Director (09May02)
    22. How to create, execute and delete a Director script (08Oct02)
    23. How to create a Director Bitmap (09Oct02)
    24. How to export a Director Bitmap (15Oct02)

    DOMAJ Links

     

    Recent Topics

    The latest topics from the forum.

    1. k-director.com: Post Updates
    2. A blog about Adobe Director
    3. Centerstage
    4. Custom Cursor...Why It Does Not Work?
    5. Director Game!
    6. cross platform
    7. database xtra for both mac and windows
    8. from windows to MAC
    9. SLIDER POSITION...
    10. Bullet points in text member
    11. Any VideoOut plugin / xtras for director mx ??
    12. Activex component install
    13. quiz
    14. how to export embedded flash swf?
    15. A BIG PROBLEM...
    16. Spining a model on a touchscreen
    17. 3D Fountain trail to avoid the Cursor
    18. HTTP
    19. SHOCKWAVE VIDEO
    20. Deleting Lines Comparing Time...I Have No Idea...
    21. Property not found error
    22. SHOCKWAVE PROBLEM
    23. PROBLEM SHOCKWAVE
    24. text field focus
    25. ExitLock CloseRequest Quit Close Gadget
    26. convert read only
    27. F10 Key Code Does Not Work
    28. Director Game Development Survey
    29. baPrintFile()
    30. How do check if a printer is printing??

    Useful Links

    Google Translate
    AltaVista Translate
    Google Glossary

    Google
    Web www.domaj.com