5 Most Recent (5)
    Text Editor (1)
    File System (2)
    List Box (5)
    Color Palette (1)
    Combo Box (8)
    Custom (3)
    Scroll Bar (1)
    Radio (1)
    Tree (1)
    Bar Chart (2)
    Ticker (2)
    Pie Chart (1)
Publisher:  Flash-db.com
Implemented By:  Flash-db.com http://www.flash-db.com/
A custom listbox component used with Flash remoting to browse images and swf files on your server.
For more information on this component visit: http://www.flash-db.com/remoting/?serviceID=14

#include "NetServices.as" 
#include "NetDebug.as" 

// check - http://www.flash-db.com/remoting/?serviceID=14 for server code and updates.

// full code is located with the download - amfphp is needed to use this component.

myResult = new Object(); 

myResult.onResult = function(result){ 

    
dirBox.removeAll();
    for (
i=(result.fileSize.length-1);i>=0;i--) {
        
        
fileName result.fileName[i];
        
fileSize result.fileSize[i];
        
fileDate result.fileDate[i];
        
fileType result.fileType[i];
        
        
// Configure Data Provider for Custom List Box
        
var directoryData     = { fileName:fileName,fileSize:fileSize,fileDate:fileDate,fileType:fileType };
        
        
// Add Items to the custom list Box
        
dirBox.addItem(fileNamedirectoryData);
    }
    
dirBox.setChangeHandler("loadImage");


myResult.onStatus = function(status){ 
    
trace("Error: " status.description); 


System.onStatus myResult.onStatus

// Create a connection to your gateway.  (Make sure to change this line)
var conn NetServices.createGatewayConnection("http:// path To /gateway.php"); 

// Specify the service you want to use.  There has to be a file called 'swfBrowse.php' in your 
// services directory. 
var myService conn.getService("swfBrowse"myResult); 

// Set up the base directory.  This is the directory where you start browsing from.  It is relative from the
// flashservices directory.

var directory "../../somedirectory/";

var 
parentDir directory;
var 
currentDir directory;

// Call the service.  Load the initial directory map.
myService.browseSWF(directory); 

// Function used for browsing lower directory's.
function browseChild(dir) {

    
// dir is passed in from a button in the component.
    
childDir currentDir+dir+"/";

    
// Call the service. 
    
myService.browseSWF(childDir);
    
    
parentDir directory;
    
currentDir childDir;
}

// used to browse parent directories.
function browseParent() {
    
currentDir parentDir;
    
// Call the service. Pass in the parent directory.
    
myService.browseSWF(parentDir);
}

// function to load images and swf's.
loadImage = function() {

    var 
imgName dirBox.getSelectedItem().data.fileName;
    var 
imgLoc currentDir+imgName;
    
trace(imgLoc);
    
loader.loadMovie(imgLoc);
    

The example remoting service class used by this component can be found here: <a href="http://www.flash-db.com/remoting/?serviceID=14">http://www.flash-db.com/remoting/?serviceID=14</a>
   download component source files (zip)


Area Map: Home | About | Extend | Links | Commercial | Submit Component    
< / form > < !-- Google analitycs -->