Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Flash Callback functions

Posted on 2004-03-22
5
Medium Priority
?
151 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 400 total points
ID: 10701962
JohnnyKnoxville did it work?
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

715 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