onLoggedIn This page was last modified over 30 day(s) ago and has 0 comment(s)

Back to FTP Class Summary

Windows, Mac OSX, Linux




Dispatched to registered listener(s) (or called via assigned handler: see notes below) when you have successfully logged into the FTP server.

Each instance of mdm.FTP requires that after a successful connection is made (that is after onLoggedIn is broadcasted, the initial directory must be set in the user code before any other FTP Class functions are performed. For example:

myFTP.onLoggedIn = function(event:Event):void
// this will set root directory

To summarize, before using any methods/properties that query a FTP instance, one should make sure that:
- The initial directory is set
- The queries are only made when the "onDirChanged" event is broadcasted

There are two ways to listen for events in 4.0:
using "onEventNameFunction" - callback based handlers introduced in {mdm} 2.0
using IEventListener model based on Events introduced in 4.0.

No matter what implementation you would use either callback and listener handler would have to use single-argument defintion as in below sample:
// callback based handlers
mdm.Appllication.onAppChangeFocus = function(event:Event):void
// proceed with event

// handlers based on IEventListener model
function onAppChangeFocusHandler(event:Event):void
// proceed with event

Example Code
// callback version
myFtp.onLoggedIn = function(event:Event):void
// you've been logged in
myFtp.loging(username, password);

// event-listener version
function onLoggedInHandler(event:Event):void
// you've been logged in
myFtp.addEventListener("onLoggedIn", onLoggedInHandler);
myFtp.login(username, password);

mdm.FTP Class Example Downloads
No Example Downloads Available

Registered Users must be logged in to 'MyAccount' to add a Comment - Log In Here
  After Logging In, Click Here to Refresh This Page