Solved

Flash Callback functions

Posted on 2004-03-22
5
148 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
To view Flash technology content error 4 6,745
Stock Videos 17 346
Can't find all of the preferences on Flash Pro 2 495
Flash Player Action Script Error 1090 5 225
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
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…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

733 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