Loading multiple SWFs and storing them (code not working under Firefox 23 and Chrome)
hey guys,
anyone has idea why code don't work anymore? (it works under internet explorer not firefox , chrome
the code under placed on main swf preload external swfs , store them not having wait long access them.
thx guys.
i took code here btw: http://www.beautifycode.com/the-finer-art-of-loading-2-handling-multiple-swfs#snippet
i'm running flash player 11.8.800.94... used work under firefox , chrome
| var _swfloader:loader; | |||
| var _swfrequest:urlrequest; | |||
| var _swfpatharr:array = new array( "00.swf", "01.swf", "02.swf" ); | |||
| var _swfclipsarr:array = new array(); | |||
| var _swftempclip:movieclip; | |||
| var _loadedswfs:int; | |||
| startloading(_swfpatharr); | |||
| function startloading(patharr:array):void { | |||
| _swfloader = new loader(); | |||
| _swfrequest = new urlrequest(); | |||
| loadswf(patharr[1]); | |||
| }; | |||
| function loadswf(path:string):void { | |||
| setuplisteners(_swfloader.contentloaderinfo); | |||
| _swfrequest.url = path; | |||
| _swfloader.load(_swfrequest); | |||
| }; | |||
| function setuplisteners(dispatcher:ieventdispatcher):void { | |||
| dispatcher.addeventlistener(event.complete, onswfcomplete); | |||
| }; | |||
| function onswfcomplete(event:event):void { | |||
| event.target.removeeventlistener(event.complete, onswfcomplete); | |||
| _swftempclip = event.target.content; | |||
| _swftempclip.customid = _loadedswfs; | |||
| _swfclipsarr.push(_swftempclip); | |||
| if(_loadedswfs <_swfpatharr.length - 1) { | |||
| _loadedswfs++; | |||
| loadswf(_swfpatharr[_loadedswfs]); | |||
| } else { | |||
| // | |||
| } | |||
| }; |
is failing when testing in flash pro, or elsewhere?
More discussions in ActionScript 3
adobe
Comments
Post a Comment