Sexta passada estava olhando o Flash Bookmarks e vi que uma dúvida foi postada em relação ao Loader.
Um tempo atrás eu precisei carregar um arquivo utilizando um Loader e depois adicionar o conteudo carregado no stage. Contudo um erro era gerado ao adicionar o conteúdo.
Last friday I was checking Flash Bookmarks and I noticed a question about Loader.
While ago I needed to load a file using a Loader and then add it to the stage. However it raised an error.
ArgumentError: Error #2025 : The supplied DisplayObject must be a child of the caller.
Para resolver o problema eu precisei extrair o conteudo em uma variavel e depois executar um loader.unload() antes de adicionar ao stage.
To solve the problem I needed to extract the conten in a var and then call a loader.unload() before add it to the stage.
function onLoadComplete(e:Event):void{ var image:Bitmap = e.currentTarget.content; loader.unload(); addChild(image); }
É o mesmo caso quando você utiliza o mesmo loader para carregar dois ou mais arquivos.
It’s the same case when you try to load two or more files using the same loader.