WimpyLoader - ActionScript

by Mike Gieson
Available at http://www.wimpyplayer.net
©2002-2006 plaino

v 1.0

WimpyLoader ActionScript version is provided so that you can load Wimpy using an external "as" (ActionScript) code..

Set up

IMPORTANT: Wimpy Loader will only work on a live web site. If you attempt to "preview" or test wimpy on a local machine, Wimpy may or may not load properly. depending on your development environment. It is best to test everything on a LIVE web server.

1. Install Wimpy on your web site.

Basically, just upload wimpy.php and wimpy.swf to a folder that contains MP3 files on your web site.

Click here for installation instructions.

2. Use the Customizer Tool to create a wimpyConfigs.xml file..

Set the options according to your needs.

In the "Wimpy Script Configuration" section of the Customizer tool, click the checkbox to "Download a wimpyConfigs.xml."

3. Save, upload and test the wimpyConfigs.xml file.

Save the resulting wimpyConfigs.xml file to your local PC

Upload wimpyConfigs.xml to the same folder that contains wimpy.php/asp/cfm and wimpy.swf.

Test the config file by accessing wimpy.php/asp/cfm directly with a web browser.

Example:

http://www.yoursite.com/mp3s/wimpy.php

Make sure that everything works OK. If Wimpy is not working, double check to make sure that you entered the proper URLs to the files specified in the Customizer tool

If everything works OK, you are now ready to configure and test Wimpy Loader, continue to step 4

If there are any problems up to this point, do not continue because if Wimpy doesn't work using the standard installation procedure, it will not magically fix itself when attempting to incorporate it into your existing Flash project.

If Wimpy Loads OK, but no files are listed in the playlist, double check to see if you have any MP3 files in the Wimpy installation folder o your web site. Also, if you are using the PHP version, and PHP is running in "safe mode," wimpy will not work. Contact your hosting provider to see if they can take PHP out of "safe mode" for your account.

If you do not have PHP, ASP or ColdFusion installed on your server, you can still use Wimpy by running wimpy off of an XML playlist rather than wimpy.php/asp/cfm. To run Wimpy off of an XML playlist, you will first have to create an XML playlist, then use the Customizer tool and set the first question "Wimpy Script" to the URL to your XML playlist. rather than wimpy.php/asp/cfm. XML playlists are used in lieu of wimpy.php/asp/cfm. Click here for more information on using XML playlists.

5. Unzip the wimpyloader package and place wimpyLoader.as into a new folder on your local PC.

We are going to first test wimpyLoader before actually integrating Wimpy into your existing flash project, simply because it is easier to troubleshoot a less-complex file rather than your existing Flash file.

6. Edit the variables

Open wimpyLoader.as in a text editor and edit the wimpySwf and wimpyConfigs variable to use a full URL to the wimpy files on your web site.

Example:

_root.wimpySwf = "http://www.yoursite.com/mp3s/wimpy.swf";
_root.wimpyConfigs = "http://www.yoursite.com/mp3s//wimpyConfigs.xml";
// Wimpy Width
_root
.wW = 300;
// Wimpy Height
_root.wH = 200;
// Wimpy X position on the stage
_root.wX = 20;
// Wimpy Y position on the stage
_root.wY = 150;

4. Open your Flash IDE and create a new blank project

Enter the following line of ActionScript code on your main stage:

.#include "wimpyLoader.as"

OR

Open wimpyLoader.as in a text editor and copy and paste all of the code into a frame on the main stage.

Save the porject as "wimpyLoader." Be sure to save your project to the same folder that contains wimpy.Loader.as.

NOTE: You must be using Actionscript version 1.0 to use the "#include" statement.

7. Save, publish and test your project

Upload wimpyLoader.html, swf to your web site and pull up wimpyLoader.html with a browser.

NOTE: Since we are using the #include statement, you do not need to upload the wimpyLoader.as file.

Example:

http://www.yoursite.com/mp3s/wimpyLoader.html

If the player works OK, continue to the next step, if not, go back to set one and try again.

 

 

Using your own Flash buttons to control Wimpy

You can use your own buttons to control wimpy by using the pre-defined functions defined in the wimpyLoader.as file.

Simply add the function call to your button as:

Example:

on (press) {
   wimpy_play();
}
on (press) {
   wimpy_pause();
}
on (press) {
   wimpy_stop();
}
on (press) {
   wimpy_next();
}
on (press) {
   wimpy_prev();
}

Ther are a few additional functions that allow you to control the playlist, Click here for more information on the available functions. (The link provided is to the JavaScript Controls "read me" -- Wimpy Loader takes advantage of the same controls that the Wimpy JavaScript Kit uses. Some of the functions defined in the document are intended for the Javascript connectivity only, however, the primary player controls are the same for both Wimpy Loader and the Wimpy Javascript Kit.