Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>-------------------------- start edit -----------------------------------</p> <p>A .fla file is a Flash IDE document! </p> <p>Where does your sourceId variable come from?</p> <p>In your example, it seems to come from flashvars, meaning that you would get the value from your SWF embedding code.</p> <p>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.</p> <p>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. </p> <p>In the external SWF you could event use Custom Event Dispatching to pass your vars...</p> <pre><code> //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... } </code></pre> <p>---------------------- end edit -----------------------------</p> <p>Your question is really not clear... I can only go by the code example you give</p> <pre><code>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 { //.... } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload