Hi Eric,
try
setTimeout( Delegate.create(myConduit, myConduit.getAutoCompleteMatches,
500, login_dialogBox_mc.entry_txt.text, user.zipcode, "6" );
instead. Should work.
~Arul Prasad
On 7/10/07, eric e. dolecki <[EMAIL PROTECTED]> wrote:
Have a scoping issue of some kind within a Class itself, seems strange.
Flash 9 AS2 SWF.
I have a class that handles some XML-RPC calls. Works great from the _root
proper, but fails when i call it from within a function... (without
getting
into all the little specifics of the code, below is enough I think to
explain it)...
some Conduit Class code:
function Conduit()
{
owner = this;
mx.events.EventDispatcher.initialize( owner );
replyXML = new XML();
send_lv = new LoadVars();
};
...
// This won't get called by interval timeline code below in this email
private function doGetAuto( sSubstring:String, sZipcode:String,
sMax:String
):Void
{
trace( "> doGetAuto" );
replyXML = new XML();
replyXML.ignoreWhite = true;
replyXML.onLoad = Delegate.create( owner, autoResponse );
send_lv = new LoadVars();
send_lv.q = sSubstring;
send_lv.zip = sZipcode;
send_lv.max = sMax;
send_lv.sendAndLoad( sAutoCompleteURL, replyXML, "GET" );
};
private function autoResponse( success:Boolean ):Void
{
if( success )
{
dispatchEvent( {target:owner, type:"autoCompleteResponse",
data:replyXML} );
} else
{
dispatchEvent( {target:owner, type:"genericError" } );
}
};
public function getAutoCompleteMatches( sSubstring:String,
sZipcode:String, sMax:String ):Void
{
trace( "getAutoCompleteMatches" );
doGetAuto( sSubstring, sZipcode, sMax );
};
...
now an example of some implementing timeline code:
// Works, see the "> doGetAuto" traced
var myConduit:Conduit = new Conduit();
myConduit.getAutoCompleteMatches( "iron", "01701", "6" );
// Doesn't work, stops at the first trace within the class (
"getAutoCompleteMatches" ) (in place of code above)
var myConduit:Conduit = new Conduit();
function createFirst():Void
{
login_dialogBox_mc.entry_txt.onChanged = entryChange;
};
function entryChange():Void
{
clearTimeout( nAutoTimer );
nAutoTimer = setTimeout( myConduit.getAutoCompleteMatches, 500,
login_dialogBox_mc.entry_txt.text, user.zipcode, "6" );
}
???
- Eric
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
Arul Prasad
http://arulprasad.blogspot.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com