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

  • SEARCH
  • Home
  • 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 6822869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:42:53+00:00 2026-05-26T21:42:53+00:00

i have a function(initialize) inside the a.as File.i want to access the that Variable

  • 0

i have a function(initialize) inside the a.as File.i want to access the that Variable from aaa.fla file?.How Can i access the Variable?my main class is a.as file ,inside a.as file i load the aaa.swf file
AnyBody Help me
Thanks in advance!

public function initialize(parameters:Object, stage:Stage, 
     loaderInfo:LoaderInfo, pluginHostWhitelist:Array):void
    {
        sourceId=loaderInfo.parameters.src;
        addText();//Inside this function i load the aaa.swf file,
        //here i want to access the variable "sourceId"
        removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
    }

 addText(){
_loader.load(new URLRequest("aaa.swf"));//while running this a.as i want to get the Sourceid Value
 mainContainer.addChild(_loader);   
    }

My aaa.fla Its in Another place

import fl.motion.ColorMatrix;
import flash.filters.ColorMatrixFilter;
var sourceId:String// here i want to access the "sourceid" variable from a.as file
trace(sourceId)
  • 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-26T21:42:54+00:00Added an answer on May 26, 2026 at 9:42 pm

    ————————– start edit ———————————–

    A .fla file is a Flash IDE document!

    Where does your sourceId variable come from?

    In your example, it seems to come from flashvars, meaning that you would get the value from your SWF embedding code.

    If this is the case, this wouldn’t be relevant in your .fla file, because you wouldn’t load an external swf using HTML embedded code.

    Let’s forget about flashvars for the time being… Are you using a Document Class with your .fla file? If not, I would advise you to, it’d make coding a lot easier. If yes, I suppose that you would load the external SWF there.

    In the external SWF you could event use Custom Event Dispatching to pass your vars…

        //in your external SWF
        private function onAddedToStage( event:Event ):void
        {
            //you could use a Custom Event
            //do some research on AS3 custom events... 
            var idEvent:YourEvent = new YourEvent();
            idEvent.sourceId = sourceID;
    
            this.dispatchEvent( idEvent );
        }
    
    
         //then in your .fla's Document Class
         private var sourceId:Object;
    
         private function addExternalSwf( event:Event ):void
         {
              var external:MovieClip = event.currentTarget.content as MovieClip;
              external.addEventListener( YourEvent.SOURCE_ID , idEventListener );
              addChild( external );
    
              //remove addExternalSwf listener here...
         }
    
         private function idEventListener( event:YourEvent ):void
         {
              sourceId = event.sourceId;
              //remove idEventListener listener here...
         }
    

    ———————- end edit —————————–

    Your question is really not clear… I can only go by the code example you give

    public function initialize(parameters:Object, stage:Stage, 
               loaderInfo:LoaderInfo, pluginHostWhitelist:Array):void
    {
        //here you're retrieving the sourceID variable
        //from the loaded SWF
        sourceId=loaderInfo.parameters.src;
    
        //Inside this function i load the a.swf file, 
        //here i want to access the variable "sourceId"...???
    
        if( sourceId != null )
             addText( sourceId );
        else
             trace('sourceID has a null value!!!!');
    
        //why do you remove the event listener here
        //and not within the onAddedToStage method???
        removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
    }
    
    private function addText(sourceId:Object):void
    {
         //....
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Java code I have function that gets file from the client in
I have function getCartItems in cart.js and I want to call that function in
I have a repository class that defines some basic Get/Save/Delete methods. Inside these, I
I have a forloop that has a call to a function inside of it.
I have one static variable declared inside a function, which is not initialized to
So I have function that formats a date to coerce to given enum DateType{CURRENT,
I have a function that gives me the following warning: [DCC Warning] filename.pas(6939): W1035
I have a function that gets x(a value) and xs(a list) and removes all
I have an associative array of objects that I want to extend with a
I have an Android project that contains a class that uses JNI to pull

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.