Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7669437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:35:44+00:00 2026-05-31T15:35:44+00:00

I going to call only clickfun() method i need urlPath value after success service

  • 0

I going to call only “clickfun()” method i need urlPath value after success service return value. but it throws stack overflow errors. Any help please.

private function clickfun(eve:Event):String{
            languagecode = "assets/myFont_en.swf";
            Defaultlanguagecode = "assets/myFont_default.swf";
            var request:URLRequest = new URLRequest(languagecode);
            var xmlURLLoader:URLLoader = new URLLoader(request);
            xmlURLLoader.addEventListener(Event.COMPLETE,loadcompletefun);
            xmlURLLoader.addEventListener(IOErrorEvent.IO_ERROR,ioerrorFun);
            xmlURLLoader.load(request); 
            return getpath();

        }

        private function getpath():String{
            if(loadcomplete == true){
                Alert.show(urlpath);
                return urlpath;
            }else
                return getpath(); 


        }
        private function loadcompletefun(e:Event):void{
            loadcomplete = true;
            urlpath = languagecode;
        }
        private function ioerrorFun(e:IOErrorEvent):void{
            loadcomplete = true;
            urlpath = Defaultlanguagecode;
        }



<mx:Panel title="Embedded Fonts Using ActionScript" width="800" height="500">
            <mx:Button label="Click" id="btn" click="clickfun(event)"/>
</mx:Panel>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T15:35:45+00:00Added an answer on May 31, 2026 at 3:35 pm

    The obvious with your remote interaction code is that loaders load data asynchronously. This means that the execution of the program continues while the loaders load data on a (virtually) different thread.

    The issue is here you call getpath() right after you have started the load. This makes loadcomplete false, and the getpath function keeps recursing and the stack overflows.

    What you SHOULD so is:

    Let your class dispatch an event. Say you dispatch just a Event.COMPLETE event.

    Tell it to the IDE like this:

    Near your class declaration, add the metadata and make your class extend EventDispatcher

    //Imports and package declaration
    
    [Event(name="complete", type="flash.events.Event")]
    public class YourClassName extends EventDispatcher {
    
        //Remaining part of class here
    

    Then, in your loadcompletefun, add this

    dispatchEvent(new Event(Event.COMPLETE));
    

    And, in the place you call clickfun, do this:

    o=new YourClassName();
    o.addEventListener(Event.COMPLETE, gp);
    

    and, declare gp as

    private function gp(e:Event):void {
        trace(getpath());
        //You now have the ability to call getpath()
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If methods/functions I'm going to call involve the need of an open SqlConnection, I
So i need to run a jdbc call that is going against a sql
Anyone know what's going wrong with below code? The system will only call the
Is there any way to make a function call only once? Suppose I have
I'm using the Stack Exchange Data Explorer to learn SQL, but I think the
I need to develop a TAPI application to instruct PBX to make outbound call.
In my ASP.NET MVC project, my actions typically call a Service layer to get
i need to call thread for every 3 sec in my application. From thread
Controller Call user = User.authenticate(params[:session][:email], params[:session][:password]) Authenticate Method in user.rb class << self def
This question doesn't relate only to MouseEvent.CLICK event type but to all event types

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.