Thanks for the tip, but ideally, I need to be able to setup different
callback functions for different URLs.
Is this stuff documented anywhere? Is there a reference API document for
ASV3 ? I've got the one from Adobe itself already, it is merely a
listing of all(?) objects and methods without any documentation.
Regards
Jorg
ctl271 wrote:
>
> It's been a while, but I think that this should work:
>
> function MyClass() {
> this.membervar = new MemberVar();
> }
> MyClass.prototype.operationComplete = function (data) {
> this.membervar.doSomething()
> }
> MyClass.prototype.blafunction = function() {
> getURL(someurl, this);
> }
>
>
>>>function MyClass(){
>>> this.membervar = new MemberVar();
>>>}
>>>
>>>MyClass.prototype.blafunction = function(){
>>>
>>> getURL(someurl, this.callbackFunction);
>>>}
>>>
>>>MyClass.prototype.callbackFunction = function(data){
>>>
>>> this.membervar.dosomething(data.content);
>>> ---> this.membervar is null or not an object here
>>>}
>>>
>>>
>>>If i change this.membervar to a public static member than it's
>>
>>fine. Is
>>
>>>this a restriction by design or per Javascript limitiation?
>
>
> I think it's a javascript thing, but not really a limitation. When
> you pass in the method, what you're really passing in is the function
> without it's context (the object), so "this" no longer has a point of
> reference, and "this.membervar" doesn't exist until you try to
> call "dosomething" on it, at which point it exists but is null.
>
> If you instead pass in an object which implements operationComplete
> (I'm sure this is some Interface, but can't find it right now),
> you're passing in the object and so the context...
>
> I've explained this poorly, but it's just my intuitive take on it;
> I've never bothered to look up the details.
>
> Similarly, the ability to provide context to the call is why I almost
> always use handleEvent for event handlers.
>
> Hope this helps...
>
> cheers,
> Chris
>
> [EMAIL PROTECTED]
> www.vectoreal.com
> homepage.usask.ca/~ctl271/
>
>
>
>
>
>
> -----
> To unsubscribe send a message to: [EMAIL PROTECTED]
> -or-
> visit http://groups.yahoo.com/group/svg-developers and click "edit my
> membership"
> ----
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/