Solved

Flash Callback functions

Posted on 2004-03-22
5
150 Views
Last Modified: 2010-04-03
This one should be easy but not sure why this doesnt work......I have a webservice call.  When the onResult event fires...I need it to call another method.  But it doesnt.  

public function getThisData() {
      
            
            var aRes:Object = _global.sessionSvc.getThis();
            aRes.onResult = function( sResult ) {
                                    trace("Calling getThatData Method");
                    getThatData();
            }
            
            aRes.onFault = function( res ) {
                  trace("Error getting This");
            }                              
      }

      public function getThatData() {
            trace("In getThat Method");
            var bRes:Object = _global.motionSvc.getThat();
                        
            bRes.onResult = function (cResult) {
                  trace("In getThat OnResult");
                                }
                               
                                bRes.onFault = function( res ) {
                  trace("Error getting That");
            }
               }

I get this trace statement.....

trace("Calling getThatData Method");

But not this one...

trace("In getThat Method");


Why???????????????????????????????????????????


thanks,

knoxxx
0
Comment
Question by:JohnnyKnoxville
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 5

Expert Comment

by:stef4s
ID: 10656004
//Try this

//instead of

aRes.onResult = function( sResult ) {
                                    trace("Calling getThatData Method");
                  getThatData();
          }

//

aRes.onResult = function( sResult ) {
                                    trace("Calling getThatData Method");
                  this.getThatData();
          }
0
 

Author Comment

by:JohnnyKnoxville
ID: 10659044
Still no luck.  It seems like when I enter..

aRes.onResult = function( sResult ) {
                                    trace("Calling getThatData Method");
                  getThatData();
          }


I cannot leave to go to another method.  If I place the 'getThatData()' call outside of the function {} it gets called.  But I need it to be called AFTER the onResult event fires.
0
 
LVL 5

Expert Comment

by:stef4s
ID: 10664863
call it with

this. getThatData();
0
 
LVL 5

Expert Comment

by:stef4s
ID: 10664874
sorry no space

this.getThatData();
0
 
LVL 5

Accepted Solution

by:
stef4s earned 100 total points
ID: 10701962
JohnnyKnoxville did it work?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question