|
NKConnect PHP Connector Last updated:
October 23rd, 2002 Description: A connection system that allows remote method invocation on a PHP class/library located on a website. In simple words, it lets you call a method on a PHP library/class located on ure website from within Flash as if the library/class was defined within Flash itself. Features: The class uses XML and sepearates each remote method that has been set, allowing you to call more the one remote method at any time and check the status of each method call. Additionally the class will not let you reset or call method if it is currently in use or waiting for a response from the server. You can define a single object with methods such as "remoteMethodName_Handler()" for each remote method you want it to handler and set this object as the Handler object. The class will search for a handler here if a specific function/handler is not set for a perticular remote method. You can set a named or anonymous function for each remote method set, dump all the handler functions in a single object or set one default handler to handle every remote method. Uses WDDX for data communication. This allows you to send numbers, booleans, strings, arrays, stuctures, objects (any thing instantiated within Flash with the exception of XML) to PHP. You can then design you PHP library to store or manupilate the objects sent. For example you can create a chat or even send a TextFormat to be stored on the server than can be read and used by other Flash clients. Supports code prompting for instance names ending with '_nkc' as used in the reference panel. Works on any shared web hosting account that supports PHP. Reference Information All information is provided in the Actionscripts panel and Reference panel from within Flash under the folder 'NKConnect PHP Connector'. Download Click to download the NKConnector component for Flash MX/PHP Remote Method Invocation Demo : nkChat Disabled. Files are included in the download ZIP file. ActionScript used to implement the chat is here
Gateway PHP Info: trapper.php Last updated: October 23rd, 2002 Terms Of Use: For personal / Non commercial use only. Please contact Nik Khilnani at nik@nuthing.com if you desire to use this application commercially. Description: This is the PHP script to be used as a gateway for instances of the NKConnector class. To you this script you MUST have PHP enabled on your webserver. Also you should know how to write a PHP class. You can use the supplied PHP code as a reference but I assume you have enough knowledge to be able to learn/write a PHP class. Installation: 1. Unzip contents of the ZIP file 'NKConnector_php_samples.zip' in the 'NKConnector.zip' file you downloaded. This contains the php code. 2. Make a new directory such as 'yourDirName' on your webserver. 3. Upload the trapper.php to this directory. You may rename the script to 'anyName.php'. Just remember to send the correct url as the gateway when instantiating a new NKConnector. 4. Make a new directory in 'yourDirName' for each library/class you wish to you. The directory name and the PHP file that contains the class definition must have the same name as the library name you use in Flash. Eg. If the library name u use in Flash is 'myLib', in the 'yourDirName' directory you should have a directory names 'myLib' with a PHP script 'myLib.php'. Ie. For a library 'myLib' yourDirName/trapper.php yourDirName/myLib/myLib.php 5. Make sure any directory you are writing to is write enabled. Speak to your server administration regarding information on doing this. This could be as simple a CHMOD 666 / read-write but no execute via an ftp application Test Applications 1. To test the sample applications supplied upload the contents of the 'trapper' directory in the 'NKConnector_php_samples.zip' to a directory called 'trapper' on your website. 2. Change the Gateway parameter in the .as files to point to 'trapper.php' on your website. 3. Test. make sure the 'trapper/nkRemoteObject/objects' directory is writable. Speak to your server administration regarding information on doing this if needed. This could be as simple a CHMOD 666 / read-write but no execute via an ftp application Revision History: v. 1
File Locations All files are located in a zip file labelled 'NKConnector_php_samples.zip' in the 'Configuration/NKConnector_php_samples' folder in the following location.
For Windows operating systems: Windows 2000 or XP: C:\Documents and Settings\user\Application Data\Macromedia\Flash MX\ Windows 98 or ME: C:\Windows\Application Data\Macromedia\Flash MX\ Windows NT: Windows directory\profiles\user\Application Data\Macromedia\Flash MX\
Note: If you cannot find the Configuration\ActionsPanel folder inside the Application Data folder, go to the the Folder Options settings for your operating system, and make sure the Hidden files and folders option is set to show hidden files and folders. See your operating system documentation for more information.
For Macintosh operating systems: Macintosh OS X: Hard Drive/Users/Library/Application Support/Macromedia/FlashMX/ Macintosh System 9.x, single user: Hard Drive/System folder/Application Support/Macromedia/Flash MX/ Macintosh System 9.x, multiple users: Hard Drive/Users/user/Documents/Macromedia/FlashMX/ |