Note that there are some explanatory texts on larger screens.

plurals
  1. POAS3: load external swf's in loop with eventListeners with parametrs
    primarykey
    data
    text
    <p>I try to make an app which connect amfphp with as3 animation. i recieve from amfphp an array which i sort by some variable in 'if' statement. after that i've got 2 arrays with arrays inside each other:</p> <pre><code>var Array1:Array = [["http://url.to.swf", "http://url.to.link"], ["",""]...]; var Array2:Array = [["http://url.to.swf", "http://url.to.link"], ... ]; </code></pre> <p>after that i run a function that read that arrays and load every swf to the stage:</p> <pre><code>ladujBajkiGorne(Array1); function ladujBajkiGorne(polkaGorna:Array):void { for(var i=0; i&lt;polkaGorna.length; i++) { Aktual = polkaGorna[i]; var mLoader:Loader = new Loader(); var mRequest:URLRequest = new URLRequest(String(Aktual[0])); mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, myfunction = function(e:Event):void { onLoadGorna( e, String(Aktual[1]) ); } ); mLoader.load(mRequest); } } </code></pre> <p>then </p> <pre><code>function onLoadGorna(e, arg1):void { userSwf = e.currentTarget.content; userSwf.buttonMode = true; userSwf.addEventListener(MouseEvent.CLICK, function(e:MouseEvent) { afterClick(e, arg1 ); }); booksMC.addChild(userSwf); var childName:String = booksMC.getChildAt(childs).name; booksMC.getChildByName(childName).x = posX; booksMC.getChildByName(childName).y = 0; posX += 218; childs++; } </code></pre> <p>and at the end</p> <pre><code>function afterClick(e, arg3) { var url:URLRequest = new URLRequest(arg3); navigateToURL(url, "_self"); } </code></pre> <p>the problem is that all swf that has been loaded has the same url in the link. it doesn't change in the ladujBajkiGorne function in addEventListener statement. I try many options to change that and nothing works. Any chance to help me with that? Many thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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