Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can a loaded child swf 1 communicate to next child swf, child swf 2, which is currently not loaded
    text
    copied!<p>I have a parent swf with three buttons: next button, back button, ticker on/off button. I have three child swfs, each with a ticker mc. When I click on ticker button on parent swf it dispatches a custom event which brings ticker MC on stage and thus ticker becomes visible (ticker off button displaces it out of stage by changing the value of ticker_mc.y). the problem I am facing is when ticker is on and I click next or back button to load next or previous child swf, the ticker goes off. How can I make sure that ticker is on all the time and closes only when I close it. How can a loaded child swf 1 communicate to next child swf, child swf 2, which is currently not loaded, that since the ticker is on on swf 1 so you please keep the ticker on on swf 2 as well?!</p> <p>I think I know the problem. I have put a default value of ticker_mc = 160 (makes ticker inactive) on every child swf. So, the ticker becomes inactive everytime I load a new child swf. If someone could guide how can I do this, my problem will be solved: When first child swf is loaded, the default value of ticker_mc.y should be 160. I want to hold this value in a variable. When I click ticker active btn, position of ticker_mc changes to 194 so the value of variable should change to 194. When I click next btn, the variable value (160 or 194) should be sent to next child swf and ticker_mc.y should be equal to variable value.</p> <p>This is the code so far </p> <p>"Next button" </p> <pre><code>go_mc.next_btn.addEventListener(MouseEvent.CLICK, playNext); function playNext(e:MouseEvent):void { if (swf_no &lt; (clips.length-1)) { swf_no++; SoundMixer.stopAll(); nextClip(); pp.play_btn.visible=false; pp.pause_btn.visible=true; } </code></pre> <p>}</p> <pre><code>function nextClip():void { thisLoader.load(new URLRequest(clips[swf_no])); </code></pre> <p>}</p> <p>//Every time I click next or back button this event is called and I remove previous swf from stage.</p> <pre><code>thisLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, doneLoading); function doneLoading(e:Event):void { stopAllChildMovieClips(stage); stage.removeChild(thisMC); thisMC=MovieClip(thisLoader.content); thisLoader.unloadAndStop(); thisMC.x=37; thisMC.y=78.50; stage.addChild(thisMC); playAllChildMovieClips(stage); </code></pre> <p>}</p> <p>//Ticker active button on parent swf</p> <pre><code>viewUnviewTxt_mc.viewTxt_btn.addEventListener(MouseEvent.CLICK, viewText); function viewText(e:MouseEvent):void{ var viewText:String = "viewTxtFunc"; dispatchEvent (new Event(viewText, true)); </code></pre> <p>}</p> <p>//To turn off ticker(default). Ticker mask is off/invisible by default(out of stage).</p> <pre><code>thisMC.tickerMaskMC.y = 160; </code></pre> <p>//custom event received on child swf</p> <pre><code>parent.stage.addEventListener("viewTxtFunc", eventHandler); function eventHandler(e:Event):void{ tickerMaskMC.y = 194; </code></pre> <p>}</p>
 

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