Home
- Integration New Media
Contents
1. JRE beside the movie or in Director s folder in authoring mode i e if theJ RE folders lib and bin are in a folder named JRE 3 If step 2 fails it checks in the W indows registry to locate the current default version used on the system Moka Xtra 20 Example See also Syntax Parameters Description Example See also 4 If step 3 fails it returns an error code 5001 on Windows gMoka xtra MokaXtra new the movi epath or gMoka xtra MokaXtra new the moviepath amp C Utils or gMoka xtra MokaXtra new the moviepath amp myClasses jar on Mac OS 9 gMoka xtra MokaXtra new the moviepath amp Utils or gMoka xtra MokaXtra new the moviepath amp Utils amp HardDrive acob myclasses on Mac OS X gMoka xtra MokaXtra new volumes judy Utils or gMoka xtra MokaXtra new Jvolumes Judy Utils volumes Jorge Tools Signature types moka_ Create avaObject moka_Create avaObject Mokalnstance ClassName Signature Argl Arg2 Mokal nstance Instance of the M oka Xtra xtra ClassName Name of the class N B the name of the class is case sensitive If the class is a class that is distributed with Java itis necessary to use the complete name see example Signature String containing the constructor class signature Argl Arg2 Parameters to pass to the method Possib
2. gMoka new xtra MokaXtra myPath See New in the M ethods Reference section of this document for more examples of how to specify the class path Checking if New was successful Y ou should always ensure that the X tra was created successfully immediately after calling New New can fail for many reasons such as a lack of free memory or as a result of misplaced files Example if NOT ObjectP gMoka then alert Moka Xtra Init Failed Creating an instance of a J ava class Once the M oka Xtra is instantiated use the method moka Create ava0Object to create an instance of the class you need to use The first parameter is the full class name The second is the signature of the class see ava types and signatures Be sure to verify if the class was created successfully before calling any M oka X tra methods that use it Example Create an instance of the java util Date class g avaDate gMoka moka_Create avaObject java util Date V check if the class instance was created if stringP gJ avaDate then call Java methods of the class else alert Error Java class not created end if Calling J ava methods M oka Xtra methods allow you to call Java class methods as well as get and set J ava class members Simple J ava method call This example converts a string entered by the user to upper case Within the java lang String class there is a function t oUpper Case Moka Xtra 13
3. Integration New Media s Moka Xtra For Macromedia Director Version 1 1 User Manual integration new media Integration N ew M edia Inc 2002 2003 M anual Version 1 2 2003 03 26 Contents Contents License Agreement Welcome to Moka Xtra System Requirements Installation Accessing custom J ava class libraries How to register your Moka Xtra license Technical support About INM Contacting us J ava types and signatures The J ClassBrowser tool Data types Object types java lang String type Signature types Using Moka Xtra Checking for a valid J RE Creating an instance of Moka Xtra Checking if New was successful Creating an instance of a J ava class Calling Java methods Simple J ava method call Passing arrays to J ava classes Starting a J ava class main function Passing an absolute path to a J ava object Destroying the instance of a class Closing the Xtra instance Debugging your code Problems on Mac OS X Basic documentation Delivering to the end user Standalone projectors Mac projectors Distributing the J ava Runtime Engine Delivering Shockwave projectors and movies Where to learn more FAQ s Demos and Tech Notes MokaXtra L discussion list Moka Xtra OW WON NYNYA HAH BND PP RP PP Ya RP Re RP PPP RP RP pp pp bb HR pp MH 6 Hp H H O O WO ON y UN OO UU Uo PB LP RW WWwoNDND NY Java web sites Methods Reference New moka_ Create avaObject moka_Destroy av
4. If the class is a class that is distributed with Java itis necessary to use the complete name see example Description Returns a multi dimensional list of information about a J ava class NOTE This method is used by the ClassBrowser tool and is NOT supported for developer usage Example Retrieve a multi dimensional list of info about the class list moka_GetClassinfo x java util Dictionary put list modifier public abstract superClass java lang Object Moka Xtra 23 Constructors methods name put Args java lang Object java lang Object return java lang Object modifier public abstract name get Args java lang Object return java lang Object modifier public abstract name size Args return int modifier public abstract name remove Args java lang Object return java lang Object modifier public abstract name elements Args return java util Enumeration modifier public abstract name keys Args return java util Enumeration modifier public abstract name isEmpty Args return boolean modifier public abstract members See also Signature types Data types moka_ GetCurrent VMinstalled Syntax moka GetCurrent VMI nstalled Parameters None Description Returns a string containing the version of the default installed J ava Virtual M achine
5. JVM or Java Runtime Engine J RE that will be used by M oka Xtra Ifthereisno VM installed moka GetCurrent VMI nstalled returns an empty string Examples e Windows Sun JRE 1 4 e MacOS 8 9 MR J 2 2 5 e MacOSX MRJ 3 x On windows a user can install more than one VM M oka Xtra uses the one declared as the default in the registry HKEY_LOCAL_ MACHI NE SOFTWARE JavaSoft Java Runtime Environment CurrentVersion Example retrieve the default Java Virtual Machine installed on Windows and initalize the Moka Xtra instance On StartMovie cur VM moka_GetCurrent VMinstalled if cur VM contains Sun JRE 1 3 OR cur VM contains Sun JRE 4 then jvmlnstalled true else jvmlnstalled False end if if jvmlnstalled then gMoka New xtra MokaXtra the Movi ePath else alert This application requires Java Virtual Machine version 1 3 or 1 4 Please install the appropriate JVM from http J ava Sun com quit end if end StartMovie See also New Moka Xtra 24 Syntax Parameters Description Example See also Syntax Parameters Description Example moka_ Get avaMember moka_Get avaMember Mokalnstance Classinstance MemberName Signature Mokal nstance Instance of the M oka Xtra xtra Classinstance Instance of the class string that contains the member Member Name Member Name Name of the member to read N B The name of the member is case sensit
6. Version of the Software you have purchased Therefore use of a Version other than the one encompassed by this License A greement requires a separate license d The Software contains a license file L1C which is subject to the restrictions set forth above and may not be distributed by you in any way However INM and its licensors grant you a royalty free right to reproduce and distribute the file named M oka X tra X 32 on Windows M oka Xtra XTR on M ac collectively Runtime Kit provided that i you distribute the Runtime K it only in conjunction with and as part of your own Products ii own a license for the specific Version of the Software that contains the Runtime Kit iii agree to indemnify hold harmless and defend INM and its licensors from and against any claims or lawsuits including attorney s fees that arise or result from the use or distribution of your Products with the Runtime Kit e Any third party who may distribute or otherwise make available a product containing the Runtime K it must purchase its own license of the Software f Any third party who will use the Runtime K it in an authoring environment must purchase its own license of the Software g Notwithstanding any other terms in this License if the Software is licensed as an upgrade or update then you may only use the Software to replace previously validly licensed versions of the same software Y ou agree that the upgrade or update does not const
7. declared as public toUpperCase Its corresponding signature is Lpava lang String In Lingo the code would look like this gMoka new xtra MokaXtra J String gMoka moka Create Ly ava lang String V if stringP JString then the moviepath avaObject java lang ext String nember UserlD t call toUpperCase method to convert string capUser D gMoka moka Ca J avaMethod J String toUpperCase Ljava lang String destroy the instance of gMoka moka_Destroy ava0bj ec else alert Error Java class end if Passing arrays to J ava cl he class J String ot created asses To pass a parameter that is an array in Java use a Lingo list Example TheJava function you are calling is declared as public String DoSomet hi ng Str The corresponding signature is ing passedString Ljava lang String Ljava lang String In Lingo the code looks like this gMoka new xtra MokaXtra the movi epath gMyClass gMoka moka Create avaObject MyClass V if stringP gMyClass then call DoSomething method passing 3 string values in a list errCode gMoka moka_CallJavaMethod gMyClass DoSomething Lj ava lang String Ljava lang String aaa bbb ccc Di else alert Error Java cl end if ass not created Starting a J ava class main function To start a J ava application that contains the mai n function use
8. loss of business information and the like whether foreseeable or not arising out of the use of or inability to use the Software or accompanying written materials regardless of the basis of the claim and even if INM or an INM representative has been advised of the possibility of such damage IN M s liability to you for direct damages for any cause whatsoever and regardless of the form of the action will be limited to the greater of US 199 00 or the money paid for the Software that caused the damages THISLIMITATION WILL NOT APPLY IN CASE OF PERSONAL INJURY ONLY WHERE AND TO THE EXTENT THAT APPLICABLE LAW REQUIRES SUCH LIABILITY BECAUSE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES THE ABOVE LIMITATION MAY NOT APPLY TO YOU 8 General This A greement will be construed under the laws of the Province of Quebec except for that body of law dealing with conflicts of law If any provision of this A greement shall be held by a court of competent jurisdiction to be contrary to law that provision will be enforced to the maximum extent permissible and the remaining provisions of this A greement will remain in full force and effect 9 The parties acknowledge having requested and being satisfied that this A greement and its accessories be drawn in English Les parties reconnaissent avoir demand que cette entente et ses documents connexes soient r dig s en anglais et s en d clarent
9. the M oka Xtra method Cal J ava Example gMoka CallJavaStaticMet hod Ljava lang String V StaticMethod myClass main lt arguments gt Passing an absolute path to a J ava object File paths are formatted differentl y depending on the operating system and there are special considerations when coding cross platform Java applications that require absolute file paths F or this reason M oka Xtra has a built in function moka_Path which automatically tests the end user s operating system and converts a file path to the format needed by J ava if necessary Moka Xtra 14 IMPORTANT NOTE moka_Path ignores all strings that contain a U nix style path or any forward slash characters Therefore applying moka_Path morethan once on the same string will have no effect Y ou should use moka_Path as you would use a type conversion function whenever you call a Java object that requires a file path Example pFile gMoka moka Create avaObject java io File Ljava lang String V moka_Path theFil eName Destroying the instance of a class W hen you are finished using aJ ava class instance use the moka Destroy avaObj ect method to destroy it and free up the memory it occupied Destroy the instance of the java util Date class gMoka moka Destroy avaObj ect J avaDate Closing the Xtra instance W hen the X tra instance
10. M oka Xtra using the New method The classes you create may be uncompressed as class files or compressed in jar or zip files See N ew in the M ethods Reference section How to register your Moka Xtra license In order to ship a product that uses M oka X tra you must purchase a license for the software Please make sure to read and agree to the License A greement see License A greement before purchasing your M oka X tra license To purchase a license visit our online store at http www IntegrationN ewM edia com store or contact us by phone at 1 800 400 1772 or 1 514 871 1333 Option 5 To register your Xtra and remove the U nregistered alert screen you need to call the M oka Xtra method moka_Register thekey at the beginning of each Director movie that uses the X tra The string parameter t heKey is the license number that was given to you by INM upon purchase of the license It must be entered in quotes To avoid making mistakes we recommend you copy paste this number from the email that Integration N ew M edia sends you Example moka Register 1R9 T6K8 2HC2 391 Technical support The M okaXtra L discussion list is the best place to get support and benefit from the experience of the community of M oka X tra users If you need further assistance or personal attention our Technical Support team is pleased to help you Contact them by E mail Moka Xtra 7 preferred or by phone See Conta
11. Platform Java VM and Java API go to http java sun com getjava index html Installation To install M oka Xtra for authoring i e in the Director application 1 Make sure Director is not running Moka Xtra 6 Note The free evaluation version of M oka Xtra contains all the functionality of the licensed version except that a Demo Version alert appears when M oka Xtra is instantiated Click the alert box to close it Note N ever distribute the license number If your movie must be sent to other developers first remove the license number from your script 2 Place the Xtra On the PC a file named M okaXtra x32 on M ac a file named M okaXtra XTR into Director s X tras folder This folder is located in the same place as the Director application a typical folder path for W indows is C Program Files M acromedia Director 8 5 X tras 3 Create a subfolder within Director s X tras folder and name it M oka Xtra 4 Movethe ClassBrowser tool the file named J ClassBrowser dcr into this new M oka Xtra folder This will ensure that the tool is available by clicking Xtras gt M oka Xtra gt J ClassBrowser from Director s menu 5 Launch Director Accessing custom J ava class libraries Java class libraries that you create may be located in any folder accessible to Director Y ou specify the path s for M oka X tra to locate them when you instantiate
12. has completed its function and is no longer required close it by calling setting the global variable to 0 Closing an Xtra performs mandatory housekeeping tasks and closes unneeded files It also frees the memory occupied by the Xtra All X tra instances created with New must be ultimately set to 0 once they are no longer needed Example set gMoka 0 Debugging your code M oka X tra has a small set of error codes that are returned when errors are encountered accessing Java objects see Error Codes However debugging your J ava code from Director is not trivial Use the M oka Xtra method moka_GetLast avaException to return the last exception thrown by a Java function It returns none if everything is OK Call moka GetLast avaException after each call to a Java method and do your own error handling based on the string value returned Once you modify your Java class you have to close and restart Director in order to load the new version of the class Problems on Mac OS X If your project seems to work correctly on Windows and M ac OS 8 9 but you are experiencing problems on M ac OS X verify any file or folder paths that are used Java expects U nix formatted absolute paths On Mac OS X all volumes except the system volume are prefixed by Vol umes W e recommend using moka_ Pat h to convert any absolute path passed to aJ ava object However beware that moka _Path will ignore any string
13. satisfaits Moka Xtra 5 Welcome to Moka Xtra Integration N ew M edia s M oka X tra blends the functionality of Java with Director s rich media interface Through the Lingo API Director applications can call Java classes and get and set the values of Java class members With this X tra multi media developers will now be able to accomplish complex tasks in Director that could not be achieved through Lingo alone Java programmers will love the ease of creating engaging user interfaces in Director To keep up with the latest M oka X tra developments bookmark the URL and visit the product site regularly http www M okaX tra com System Requirements e Director 7 and higher including Director M X on both M ac OS X and Windows Macintosh e All Macintosh computers equipped with M ac OS 8 1 and higher including M ac OS X e MacOS Runtime for Java MRJ version 2 1 or later installed on the end user s system The M RJ is included with the M ac OS It is recommended to use M RJ 2 2 because of bugs in version 2 1 For versions of M ac OS prior to 8 6 you will probably have to upgrade the M RJ because M RJ 2 1 began shipping with M ac OS 8 6 Windows e All Windows computers equipped with Windows 9x NT 2000 XP e SunJRE Java Runtime Environment 1 3 x or 1 4 x installed on the end user s system or distributed with the projector see D elivering to the end user To download Sun s J ava
14. system so there is less of a need to distribute it with your application H owever there is no guarantee on Windows that your end user has a valid J VM or what version is installed To ensure that your W indows end user has the VM for your application you can distribute the Java Runtime Engine with your project on CD W hen M oka Xtra is initialized using NEW it looks for a valid JRE using the following algorithm 1 Check if there isaJRE right beside the movie or in Director s folder in authoring mode i e if the J RE folders lib and bin are at the same level as the application either your projector or Director 2 If step 1 fails it checks if the J RE is located in a folder named JRE beside the movie or in Director s folder in authoring mode i e if the RE folders lib and bin are in a folder named JRE 3 If step 2 fails it checks in the W indows registry to locate the current version used on the system 4 If step 3 fails it returns an error code 5001 For more information on distributing the Sun JRE go to http servlet java sun com help legal_and_licensing 63 Moka Xtra 17 Delivering Shockwave projectors and movies Because M oka X tra allows you to call any Java class from Director both the standard JVM classes and your own customized classes it cannot be Shockwave safe That is we cannot guarantee that the J ava classes it accesses
15. the instances of the classes gMoka moka_ J avaDateFor mat gMoka moka Destroy avaObj ect J avaDate moka_ Create avaO bject moka_ Call avaM ethod moka_CallStatic avaM ethod moka_G et avaM ember moka_G etStatic avaM ember moka_ Call avaMethod moka_CallJavaMethod Mokalnstance Classinstance MethodName Signature Argl Arg2 Mokalnstance Instance of the M oka X tra xtra Classinstance Instance of the class string that contains the method Met hodName MethodName Nameof the method to call N B Thename of the method is case sensitive Signature String containing the method signature Argl Arg2 Parameters to pass to the method Possible Lingo types Integer Float Date String or List Execute a call to a class s method The data type returned depends on the signature used If an instance of a class is returned this instance must be destroyed in the call tothemoka_ Destroy avaObj ect method A negative value is returned in the case of an error Create an instance of the java util Date class JavaDate gMoka moka Create avaObject java util Date V Retrieve an instance of java text DateFormat JavaDateFormat gMoka moka Call Static avaMet hod Moka Xtra 22 put today s date into the message window put gMoka moka_CallJ avaMet hod Destroy the instances of the classes gMoka moka_Destroy avaObj ect J avaDateFor mat gMoka moka Destroy avaObj ect J avaDate See also Sign
16. will not be harmful Therefore if you need to deliver your project as a Shockwave movie you must create your own Verisign approved auto download package The support team at Integration N ew M edia can assist you in creating the Shockwave auto download package In order to do this you would first need to obtain your own Verisign certificate For more information contact our support team at Support ntegrationN ewM edia com Moka Xtra 18 Where to learn more FAQ s Demos and Tech Notes The M oka Xtra FAQs page on IN M s website is where you can find answers to questions you might have about the product s capabilities and requirements Visit the FAQ page at http www M okaX tra com FAQ For answers to technical questions visit the Tech Notes section Tech notes address specific technical issues that have been identified by IN M s development team and by support cases that are reported Technotes often contain sample code and sample movies that can help increase your productivity with the X tra http www IntegrationN ewM edia com support M okaX tra Tech N otes To help you get started quickly with M oka X tra we have posted open source demo projects that use M oka X tra and custom J ava classes Download these demos from http www M okaX tra com demos MokaXtra L discussion list M okaX tra L is a mailing list devoted to discussions on M oka Xtra and related topics N ew announcements concerning M ok
17. a Xtra are also posted in this forum Subscribe to this list by clicking http www IntegrationN ewM edia com support list Java web sites On the web you can find many sites that provide ava classes tutorials and projects H ere are just a few that may be useful e Java Sun com home page e Sun sJavaAPI doc e Apache akarta Project e Jakarta Excalibur e GameLan Repository e Cloudscape J ava database e PointBase J ava database e Apple s Java developer doc Moka Xtra 19 Syntax Parameters IMPORTANT NOTE The path formats specified here are only to be used in M oka Xtra s New method If you are passing an absolute file path as a parameter to a Java method you should use moka_Path method to ensure that the path is properly formatted for the user s operating system Description Methods Reference The example code shown in this section uses the dot syntax where the object name is specified followed by a followed by the method name and its parameters in parentheses In this example gMoka isthe instance of the M oka Xtra and the method moka_Destroy avaObj ect is called to destroy the instance of the avaDat eFor mat class gMoka moka_ Destroy avaObj ect J avaDateFor mat The equivalent expression without using the dot syntax looks like this moka_DestroyJavaObject gMoka avaDateFor mat New New xtra MokaXtra UserClassPath User Cl ass Pat
18. aObject moka_Call avaMethod moka_CallStatic avaMethod moka_GetClassinfo moka_GetCurrent VMInstalled moka_Get avaMember moka_GetLast avaException moka_GetStatic avaMember moka_Path moka_Register moka_Set avaMember moka_SetStatic avaMember moka_TranlsateToSignature Error Codes Index Apple M ac and M acintosh are trademarks or registered trademarks of A pple Computer Inc in the United States and or other countries M acromedia Director and X tra are trademarks or registered trademarks of M acromedia Inc in the United States and or other countries M icrosoft Internet Explorer Windows and W indows NT are trademarks or registered trademarks of M icrosoft Corporation registered in the U S and or other countries Sun Sun M icrosystems and the J ava technology are trademarks or registered trademarks of Sun Microsystems Inc in the U nited States and other countries Other trademarks trade names and product names contained in this manual may be the trademarks or registered trademarks of their respective owners and are hereby acknowledged Moka Xtra 3 19 20 20 21 22 22 23 23 24 25 25 26 26 27 27 28 28 29 30 License Agreement PLEASE READ THIS LICENSE AGREEMENT CAREFULLY BEFORE USING Integration New M edia s MOKA XTRA BY USING Integration New M edia s M OKA XTRA YOU AGREE TO BECOME BOUND BY THE TERMS OF THISLICENSE AGREEMENT The enclosed computer program s license file and data collectiv
19. all this method before attempting to create an instance of M oka Xtra This way if there is no JVM present you can alert users to download the version of VM they need or even send them to the URL where they can download the J VM before running your application see moka_G etC urrent VM Installed in the M ethods Reference section of this manual Creating an instance of Moka Xtra Call New to create an instance of M oka X tra Generally you store a newly created X tra instance in a global variable for future use The following example uses the New method of M oka X tra Example gMoka new xtra MokaXtra the moviepath Moka Xtra 12 Note If you are using static J ava methods and members you do not need to create an instance of those classes before referencing them In this case just use the object name directly rather than the instance variable See moka_CallStatic avaM ethod moka_G etStatic avaM ember moka_ The first parameter is M oka Xtra The second parameter is a string that contains the absolute path or paths to your custom classes Separate multiple paths using a semi colon Y ou must specify the full absolute path However you can use Director s properties the moviePath andthe appl icationPath so you only need to append the relative path Example myPath the applicationpath amp myClassl amp the applicationpath amp myClass2 amp the applicationpath amp myClass3
20. ature types D ata types moka_D estroy avaO bject moka_CallStatic avaMethod Syntax moka Call Static avaMethod Mokalnstance ClassName MethodName Signature Argl Arg2 Parameters Mo ka ns tance Instance of the M oka Xtra xtra ClassName Name of the class not an instance N ote that the name of the class is case sensitive If the class is a class that is distributed with Java itis necessary to use the complete name see example Met hodName Name of the method to call N B The name of the method is case sensitive Signature String containing the method signature Argl Arg2 Parameters to pass to the method Possible Lingo types Integer Float Date String or List Description Execute a call to a class s static method The data type returned depends on the signature used If an instance of a class is returned this instance must be destroyed in the call to the moka_ Destroy avaObj ect method A negative value is returned in the case of an error Example Retrieve an instance of java text DateFormat JavaDateFormat gMoka moka_ Call Static avaMethod java text DateFormat getDatelnstance l Ljava text DateFormat 0 See also Signature types D ata types moka_D estroy avaO bject moka_GetClassinfo Syntax moka _GetClasinfo Mokalnstance ClassName Parameters Mo ka nstance Instance of the M oka Xtra xtra ClassName Name of the class not an instance N ote that the name of the class is case sensitive
21. cting us below Licensed users are given priority status when contacting Technical Support About INM Integration N ew M edia IN M specializes in the development of cross platform software components for multimedia applications and on line communication networks INM offers a wide range of products solutions and services related to multimedia applications Our Home Pageis located at http www IntegrationN ewM edia com W e develop high quality products such as V 12 D atabase Engine GoldenG ate Database Connector SecureN et X tra and PDF Xtra and also offer customized services at various levels including e Programming Services W e offer programming expertise in Director Authorware C J ava Flash programming and Visual Basic Our expert programmers can provide you with the programming support you need while remaining completely behind the scenes e Turnkey Solutions We have the experience and expertise to manage and develop entire new media projects from conception to completion e Custom Xtras With our years of experience and proven track record we are sure to develop the right custom X tra for your Director or Authorware project e Emergency Assistance W e can provide emergency assistance for questions or issues that are specific to your project For further information about our services please contact our Sales team see below Contacting us W eencourage you to contact us with questions comment
22. developed Java classes you must first create an instance of the M oka Xtra and an instance of each J ava class you want to use When you are finished using a Java class you must destroy its instance When you no longer need the M oka X tra instance you must destroy it also The basic procedure for using M oka X tra is as follows 1 Check for a valid Java Runtime Engine J RE 2 Create an instance of the M oka Xtra 3 Create instances of any classes you want to use except for static methods members 4 Call the relevant M oka Xtra methods to call Java methods or get set member variables 5 Destroy the class instances you created previously 6 Set the global M oka Xtra instance to zero Checking for a valid J RE On Mac OS 8 and higher the Java Runtime Engine J RE ships with the operating system It is called M ac OS Runtime for Java MRJ theversion number Therefore you don t need to check if there is a Java runtime engine on M ac unless you need a specific version of the M RJ On Windows you have two options 1 Distribute the VM alongside your projector on CD ROM see Distributing the Java Runtime Engine 2 Check to make sure the user has a valid Java Runtime Engine installed The method moka GetCurrent VMI nstalled returns a string containing the default installed Java Virtual M achine If thereis no JVM installed it returns an empty string Y our application should c
23. ely Software are licensed not sold to you by Integration N ew M edia Inc IN M for the purpose of using it for the development of your own products Products only under the terms of this Agreement INM and its licensors reserve any rights not expressly granted to you INM and its licensors grant you no right title or interest in or to the Software The Software is owned by INM and its licensors and is protected by International copyright laws and international treaties 1 License a You may install one copy of the Software on a single W indows compatible computer and one copy on a single M acintosh compatible computer To install the Software means that the Software is either loaded or installed on the permanent memory of a computer i e hard disk This installed copy of the Software may be accessible by multiple computers however the Software cannot be installed on more than one computer at any time Y ou may only install the Software on another computer if you first remove the Software from the computer on which it was previously installed You may not sublease rent loan or lease the Software b Y ou may make one copy of the Software in machine readable form solely for backup purposes As an express condition of this Agreement you must reproduce on each copy any copyright notice or other proprietary notice that is on the original copy supplied by IN M c Y our license is limited to the particular version collectively
24. er is case sensitive Signature String containing the member s signature Change the content of a static member of a class A negative value is returned in the case of an error change the value of the current date gMoka moka_SetStaticJavaMember java util Calendar DAY_OF_MONTH I 5 Signature types D ata types moka_G etStatic avaM ember moka_TranlsateToSignature moka_TranslateToSignature Mokal nstance avaType Mokalnstance Instance of the M oka X tra xtra J avaType string containing a Java type Returns the signature of a Java variable type The J ClassBrowser tool uses this method to build up the signature of Java classes methods and members NOTE This method is used by the J ClassBrowser tool and is NOT supported for developer usage put moka_TranslateToSignature x byte B Signature types Data types Moka Xtra 28 Error Codes 5001 5002 5003 5004 5005 5006 5007 5008 5009 U nable to create Java virtual machine TheJava virtual machine was already created No more memory available U nable to find class Unable to find method Invalid call to a Java method Invalid argument Invalid class instance Invalid license number Moka Xtra 29 Index Cc Checking for local JVM 12 Class instance creating 13 destroying 15 Closing an Xtra 15 Contact Information 8 Creating Xtra Instance 12 D Data types 10 Debugging 15 De
25. g contains the number of milliseconds that have passed since J anuary 1 1970 String java lang String Object string in the format lt J ava Class ClassN ame 0x gt List all list elements must be array of the same type Object types When Java returns a reference to an object except java lang String Lingo receives this reference in the form of a string the content of which resembles an xtra instance value e g lt J ava Class java util Date 0x45A E5400 gt If the reference is equal to lt null gt Lingo receives the string NULL java lang String type The java lang String type is automatically converted by the xtra to a string upon input and output Signature types M ost of M oka X tra s methods require the signature of the ava method to be executed This table shows how each variable type is represented in the signature Signature Type Z boolean B byte C char S short int J long F float D double Moka Xtra 10 V void L fully qualified class fully qualified class type type arg types ret type method type Examples M ethod Signature Public F ct V Public int F ct String Public int F ct int String Ljava lang String IL java lang String l Moka Xtra 11 Using Moka Xtra To take advantage of the VM classes or your own custom
26. h String containing the list of access paths to the classes On all the platforms the paths must be absolute The formats vary depending on the operating system e OnWindows drive pathl path2 The folder separator is backslash Multiple paths are separated by a semi colon e OnMacOS8 9orX drive pathl path2 The folder separator is colon Multiple paths are separated by a semi colon e OnMacOS X using the U nix way volumes drive pathl path2 The folder separator is forward slash The path must start with volumes Multiple paths are separated by a colon There should be no spaces between the paths and delimiters but there can be spaces within folder names If the Java classes are contained in a file of type jar or zip the access path must also include the full name of the jar or zip file Create a new instance of the M oka Xtra xtra At this time the ava Virtual M achine is started On Mac there is only one version of the VM installed so you don t have to worry about where it is located On Windows M oka Xtra uses the following algorithm to locate the J RE to start 1 Moka Xtra checks if there isaJRE right beside the movie or in Director s folder in authoring mode i e if the RE folders lib and bin are at the same level as the application either your projector or Director 2 If step 1 fails it checks if the J RE is located in a folder named
27. itute the granting of a second license to the Software i e you may not use the upgrade or update in addition to the software it is replacing nor may you transfer the software which is being replaced to a third party 2 Restrictions a The Software contains trade secrets in its human perceivable form and to protect them you may not MODIFY TRANSLATE REVERSE ENGINEER REVERSE ASSEMBLE DECOMPILE DISASSEM BLE OR OTHERWISE REDUCE THE SOFTWARE TO ANY HUMAN PERCEIVABLE FORM YOU MAY NOT MODIFY ADAPT TRANSLATE RENT LEASE LOAN OR CREATE DERIVATIVE WORKS BASED UPON THE SOFTWARE OR ANY PART THEREOF b THE SOFTWARE IS NOT INTENDED FOR USE IN THE OPERATION OF NUCLEAR FACILITIES AIRCRAFT NAVIGATION AIR TRAFFIC CONTROL OR OTHER ENVIRONMENTSIN WHICH THE FAILURE OF THE SOFTWARE COULD LEAD TO DEATH PERSONAL INJURY OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE c You may not transfer or assign your rights under this License to another party without IN M s prior written consent Assignment application forms can be obtained from IN M s sales department 3 Copyright notices Y ou may not alter or change IN M s and its licensors copyright notices as contained in the Software Y ou must include a copyright notice in direct proximity to your own copyright notice in substantially the following form Portions of code are Copyright 2001 2003 used under license by Integration N ew M edia Inc 4 Acceptance The Software shall be deemed accep
28. ive Signature String containing the member signature Returns the content from a member of a class instance T he type of data returned depends on the signature used If an instance of a class is returned this instance must be destroyed in the call to the moka Destroy avaObj ect method A negative value is returned in the case of an error Create an instance of the Test class Test gMoka moka Create avaObject Test V Retrieve the value myField gMoka moka_ Get avaMember Test field l Detroy the instance of the class gMoka moka_ Destroy avaObj ect Test Signature types D ata types moka_D estroy avaO bject moka_Set avaM ember moka_GetLast avaException moka GetLast avaException None Returns a string containing the last exception thrown by a Java function If no exception was thrown moka_GetLast avaException returns None In message window put getLast avaExcepti on jJava util zip ZipException ZIP file must have at least one entry In code err p avaVM moka Call avaMethod pZipOutputStreamEx zip Lp ava lang String I theName theBufferSi ze if err lt gt 0 then if getLast avaException contains ZIP file must have at least one entry then alert File not found Check that the path is correct end if end if Moka Xtra 25 Syntax Parameters Example See also Syntax Parameters Description moka_GetStatic avaMember moka_Ge
29. le Lingo types Integer Float Date String or List Create an instance of the M oka Xtra xtra The reference is returned in the form of a string A negative value is returned in the case of an error Create an instance of the java util Date class JavaDate gMoka moka Create avaObject java util Date V if stringP JavaDate then manipulate the date Destroy the instance of the class gMoka moka Destroy avaObj ect J avaDate else alert Error Java class not created end if Signature types D ata types moka_D estroy avaO bject Moka Xtra 21 Syntax Parameters Description Example See also Syntax Parameters Description Example moka_ Destroy avaObject moka DestroyJavaObj ect Mokailnstance Class nstance Mokalnstance Instance of the M oka Xtra xtra Classinstance Instance of the class to be destroyed string Destroy an instance of a class This method must be called subsequent to a call to the moka_ Create avaObj ect method or when an instance of a class is returned to Lingo by the methods moka_CallJ avaMethod moka_Call Static avaMethod moka_Getj avaMember or moka Get Static avaMember A negative value is returned in the case of an error Create an instance of the java util Date class JavaDate gMoka moka Create avaObject java util Date V Retrieve an instance of java text DateFormat JavaDateFormat gMoka moka Call Static avaMet hod manipulate the date Destroy
30. livering to end user 17 Destroying class instance 15 Destroying Moka Xtra instance 15 Dot Syntax 20 E Error checking 15 Error Codes 29 l Installation 6 Integration New Media Inc 8 J Java class paths 7 JClassBrowser tool 9 L License Agreement 4 Licensing 7 M Methods 16 moka_CallJavaMethod 22 moka_CallStaticJavaMethod 23 moka_CreateJavaObject 21 moka_DestroyJavaObject 22 moka_GetClassInfo 23 moka_GetCurrentJ VMInstalled 24 moka_GetJavaMember 25 moka_GetLastJavaException 25 moka_GetStaticJavaMember 26 moka_Path 26 moka_Register 27 moka_SetJavaMember 27 moka_SetStaticJavaMember 28 moka_TranlsateToSignature 28 New 12 20 Methods Reference 20 Moka Xtra Instance 12 moka_Path 14 15 O Object types 10 P paths 13 14 15 R Registration 7 S Signature Java class browser tool 9 Signature types 10 Standalone projectors 17 Syntax 20 System Requirements 6 ke Moka Xtra J 30
31. not have to worry about the conversions needed for Java On Windows this function does not alter the path On Mac the path is converted to a Unix path The conversion is slightly different depending on if it s OS 8 9 or Mac OS X and depending on which volume the path references the system volume is treated differently on OS X Usemoka_Path as you would use a type conversion function whenever you call a Java object that requires a file path moka_Path ignores all strings that contain a U nix style path or any forward slash characters Therefore applying moka_Path more than once on the same string will have no effect Moka Xtra 26 Example Syntax Parameters Description Example See also Syntax Parameters Description Example See also theFileName the moviePath amp myfolder myfile convert the path within the Moka Xtra method call gFileObj gMoka moka_Create avaObject java io File Lj ava lang String V moka_Path theFil eName moka_ Register moka_Register theKey theKey String containing a valid license number Change the content of a member of a class instance A negative value is returned in the case of an error moka_Register 1R9 T6K8 2HC2 391 How to register your M oka Xtra license moka_ Set avaMember moka_SetJavaMember Mokalnstance Classinstance MemberName Signature Arg Mokal nstance Instance of the M oka Xtra xtra Classin
32. obal handlers moka_Register string moka_GetCurrentj VMI nstalled moka_GetLast avaException M ethods that expect a fixed number of parameters are those for which each parameter is listed M ethods that accept a variable number of parameters are those followed by a Moka Xtra 16 NOTE Since version 1 4 1 Sun permits the redistribution of the JRE with a value added application Delivering to the end user Standalone projectors For playback as a standalone projector you must deliver the M oka Xtra file on Windows M okaX tra X 32 on M ac M okaX tra X TR in a folder named X tras located in the same folder as the projector itself You also need to put your custom J ava classes somewhere within that folder and specify that path in the M oka Xtra New method Mac projectors Director M X treats M ac OS X and Classic M acOS M ac OS 8 6 9 x as separate platforms requiring separate executables H owever through Director M X there is a way to distribute a single a cross platform projector that runs on both M ac OS 9 x and MacOSX For complete details on this solution go to the technote named Considerations for creating a M acintosh projector bundle on M acromedia s website http www macromedia com support director ts documents bu ndle_proj htm Distributing the J ava Runtime Engine On Mac OS 8 and higher the Sun Java Runtime Engine is included with the operating
33. ol J ClassBrowser dcr is a Shockwave movie that comes with the M oka X tra download package Before starting Director you should place this file in a folder named M oka Xtra within Director s X tras folder The ClassBrowser tool is then accessible from Director as a MIAW moviein a window by clicking X tras gt M oka Xtra gt J ClassBrowser from the menu bar Follow these steps to retrieve the signature of a Java method or member 1 Click the Paths button to add the paths where your own J ava classes reside Y ou don t have to enter the path for the currently installed JVM Once your paths are defined click OK 2 IntheClass Name field type in the name of a class Remember it is case sensitive Click G et Info to see a listing of all the methods and members of that class 3 Click the Super Class button if you want information about the parent class 4 Usethe back and forward arrow buttons to go back to previous classes 5 Click a method or member name and the J ClassBrowser displays the possible declarations in a field below 6 If there are multiple declarations click the one you want to execute and its signature is displayed Click Copy to copy the signature to the clipboard Then paste it directly into your Lingo code Moka Xtra 9 Data types This table shows the ava equivalents of Lingo types Lingo Java Integer int byte boolean short long Float float double Date lon
34. s containing the forward slash character Therefore you cannot append a M ac Classic style path with colon Moka Xtra 15 folder delimiters to an already converted U nix path and pass that string to moka_Path TheZipSample demo project available on our website illustrates how to deal with this issue http www M okaX tra com demos Basic documentation The M ethods Reference section of this manual describes all the M oka Xtra methods and provides examples of their usage In addition Director has a built in mechanism that provides quick documentation for Lingo developers as you work In the M essage W indow type put interface Xtra MokaXtra where Xtra M okaX tra is the name of the X tra library not of an instance of the X tra The above command returns the following X tra description xtra MokaXtra Moka Xtra 1 1 Release 7 c 1999 2003 Integration New Media Inc new object me string moka_CreateJavaObject object me string string moka_DestroyJavaObject object me string moka_CallJavaMethod object me string string string moka_Call Static avaMethod object me string string string moka_GetJavaMember object me string string string moka_Set avaMember object me string string string any moka_GetStatic avaMember object me string string string moka_SetStatic avaMember object me string string string any moka_GetClassinfo object me string moka_TranslateToSignature object me string Gl
35. s or feedback W e can be reached at Integration N ew M edia Inc 1425 Rene L evesque W est Suite 906 M ontreal Quebec Canada H 3G 1T7 Phone 1514 871 1333 Option 5 1 800 400 1772 N orth A merica Info info IntegrationN ewM edia com Sales sales IntegrationN ewM edia com Support support IntegrationN ewM edia com W eb http www IntegrationN ewM edia com Moka Xtra 8 IMPORTANT NOTE The path format differs depending on the platform Follow the examples at the top of the Paths window Java types and signatures Understanding the concept of Java types and signatures is fundamental to using M oka Xtra M ost of the M oka X tra methods require the signature of the ava class method or member you are accessing as one of the parameters Because ava methods can be overloaded there are more than one way to use them the signature uniquely identifies which implementation of a method you are using To help you obtain the correct signatures and reduce the risk of errors in typing them we have developed the J ClassBrowser tool The J ClassBrowser tool The ClassBrowser tool retrieves the names of all methods and members for Java classes accessible on your local machine and gives you their signatures Because Java signatures are not easy to remember and they are case sensitive this tool is very helpful to use while coding M oka Xtra method calls in Lingo The ClassBrowser to
36. stance Instance of the class string that contains the member Member Name Member Name Name of the member to read N B The name of the member is case sensitive Signature String containing the member signature Arg Valueto put into the member instance Possible Lingo types Integer Float Date String or List Change the content of a member of a class instance A negative value is returned in the case of an error Create an instance of the Test class Test gMoka moka Create avaObject Test V Retrieve a value myField gMoka moka_GetJavaMember Test field odify the value in Lingo myField myField specialValue Set the value in the class myField gMoka moka_ Set avaMember Test field l Call some methods of the class Detroy the instance of the class gMoka moka Destroy avaObject Test Signature types D ata types moka_G et avaM ember Moka Xtra 27 Syntax Parameters Description Example See also Syntax Parameters Description Example See also moka_SetStatic avaMember moka SetStatic avaMember Mokalnstance ClassName MemberName Signature Arg Mokal nstance Instance of the M oka Xtra xtra ClassName Name of the class N B The name of the class is case sensitive If the class is a class that is distributed with J ava itis necessary to use the complete name see example Member Name Name of static member to change N B The name of the memb
37. tStatic avaMember Mokalnstance ClassName MemberName Signature Mokal nstance Instance of the M oka X tra xtra ClassName Name of the class N B the name of the class is case sensitive If the class is a class that is distributed with Java itis necessary to use the complete name see example Member Name Name of the member to read N B the name of the member is case sensitive Signature String containing the member signature Create an instance of the java util Date class JavaDate gMoka moka Create avaObject java util Date V Retrieve the value of member FULL dateFull gMoka moka_Get Static avaMember java text DateFormat FULL j Retrieve an instance of java text DateFormat JavaDateFormat gMoka moka_ Call Static avaMet hod put today s date into the message window put gMoka moka_ Call avaMethod J avaDateFormat format Lpava util Date Ljava lang String J avaDate Detroy the instances of the classes gMoka moka_Destroy avaObj ect avaDateFor mat gMoka moka_Destroy ava0Obj ect J avaDate Signature types D ata types moka_D estroy avaO bject moka_TranlsateT oSignature moka_Path moka _Path thePath thePat h String containing a valid absolute path Converts an absolute path to the correct format for Java depending on the operating system This function allows you to use Director s global variables the moviePath andthe applicationPath within your code and
38. ted by you upon delivery unless you provide IN M within two 2 weeks therein with a written description of any bona fide defects in material or workmanship 5 Termination This A greement is effective until terminated This A greement will terminate immediately without notice from INM or judicial resolution if you fail to comply with any provision of this A greement U pon such Moka Xtra 4 termination you must destroy the Software all accompanying written materials and all copies thereof and Sections 6 and 7 will survive any termination 6 Limited Warranty INM warrants for a period of ninety 90 days from your date of purchase as evidenced by a copy of your receipt that the media on which the Software is recorded will be free from defects in materials and workmanship under normal use and the Software will perform substantially in accordance with the manual IN M s entire liability and your sole and exclusive remedy for any breach of the foregoing limited warranty will be at IN M s option replacement of the disk refund of the purchase price or repair or replacement of the Software 7 Limitation of Remedies and Damages In no event will IN M its parent or subsidiaries or any of the licensers directors officers employees or affiliates of any of the foregoing be liable to you for any consequential incidental indirect or special damages whatsoever including without limitation damages for loss of profits business interruption
Download Pdf Manuals
Related Search
Related Contents
IMPORTANT ULTRA COMM+422.PCI USER MANUAL MANUAL DE OPERAÇÃO-W-1-FINAL Ladibug™ Visual Presenter Bildsoftware Benutzerhandbuch Philips Notebook sleeve SLE1500EN Guide du parrainage Ariens Sno-Thro PM-32-77 User's Manual Measurement Specialties PCI-2513 Computer Hardware User Manual Adenda No1 RELACION BIBLIOTECA - Colegio Oficial de Ingenieros Técnicos Copyright © All rights reserved.
Failed to retrieve file