| 1 | == Skin Organization when creating new widget == |
| 2 | |
| 3 | To create your own new skin for your own new widget follow the instructions below. |
| 4 | |
| 5 | You can organize the skin system in your widget in any way you want. The recommended way is to use Flash internal runtime sharing. To use it you should make the following: |
| 6 | |
| 7 | Any library elements in your application that you want to define with your skin should be copied to the skin file. After all elements are copied, do the following with every library element: |
| 8 | |
| 9 | |
| 10 | 1. Select a movie clip, button, graphic symbol, bitmap, or sound in the Library panel and select Properties from |
| 11 | the Library options menu. Click the Advanced button to expand the Properties dialog box. |
| 12 | |
| 13 | 2. For Linkage, select "Export for !ActionScript" and "Export in first frame". |
| 14 | |
| 15 | 3. Enter an identifier for the symbol, bitmap, or sound in the Identifier. Do not include spaces. |
| 16 | |
| 17 | 4. Find the respective element in application library and open Linkage dialog. |
| 18 | |
| 19 | 5. For Linkage, select "Import for runtime sharing". |
| 20 | |
| 21 | 6. Enter URL: "'''skins/'''". |
| 22 | |
| 23 | After all elements in the skin file are done, publish the skin file. |
| 24 | |
| 25 | All skin files should be located in the "skins" folder of your widget package. If you use this way of skin organization, you should create an '''index.php''' file in the same folder with the following contents: |
| 26 | |
| 27 | {{{ |
| 28 | <? |
| 29 | setlocale(LC_ALL, 'EN_US'); |
| 30 | header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); |
| 31 | header("Content-Type: application/x-shockwave-flash"); |
| 32 | require_once("../../global/inc/header.inc.php"); |
| 33 | require_once($sIncPath . "functions.inc.php"); |
| 34 | require_once($sIncPath . "apiFunctions.inc.php"); |
| 35 | require_once($sIncPath . "xml.inc.php"); |
| 36 | $aPathParts = explode("/", $_SERVER['PHP_SELF']); |
| 37 | $iPartsCount = count($aPathParts); |
| 38 | $aResult = getExtraFiles($aPathParts[$iPartsCount-3], $aPathParts[$iPartsCount-2]); |
| 39 | $sFile = $aResult['current'] . "." . $aResult['extension']; |
| 40 | readfile($sFile); |
| 41 | ?> |
| 42 | }}} |
| 43 | |
| 44 | This file is necessary to define and display skin files according to a user's previous choice saved as a cookie in one's browser. |