Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Flash Callback functions

Posted on 2004-03-22
5
Medium Priority
?
153 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
  • 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

782 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