Bueno he visto progresos en esto de agregar paginas en una revista de manera dinamica... por lo menos en la primera vuelta... ya luego veo que gestos hace en la segunda vuelta... este es el codigo:
Código Flex:
Ver originalprivate function paginasInHandler(event:ResultEvent):void
{
var tmp:XMLList = new XMLList(event.result);
revista = new XMLList(tmp.galeria.node);
imgPaginas = new ArrayCollection();
var libro:Book = new Book();
libro.width=500;
libro.height=300;
libro.openAt=0;
libro.autoFlipDuration=500;
libro.easing=0.7;
libro.regionSize=150;
libro.sideFlip=true;
libro.hardCover=true;
libro.hover=true;
libro.snap=false;
libro.flipOnClick=true;
//libro.tearable=true;
var pagina:Page = new Page();
pagina.tearable=true;
libro.addChildAt(pagina,0);
for(var i:int=0;i<periodico.length();i++)
{
imgPaginas.addItem({source:"http://localhost/thumbs/"+periodico[i].@id+".jpg"});
var img:Image = new Image();
img.source="http://localhost/thumbs/"+revista[i].@id+".jpg";
pagina.addChildAt(img,i);
libro.addChildAt(pagina,i);
}
stage2.addChildAt(libro,0);
}
Aqui ya me muestra otro error y este es al momento de poner el libro en el stage2 que es un canvas
Código Flex:
Ver original<mx:Canvas width="100%" height="100%" left="0" top="80" id="stage2" visible="true" backgroundColor="#F5B366">
</mx:Canvas>
y me genera este error, no se que como puedo corregirlo:
Código Error:
Ver originalRangeError: Error #2006: El índice proporcionado está fuera de los límites.
at flash.display::DisplayObjectContainer/getChildAt()
at mx.core::Container/getChildAt()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2377]
at com.rubenswieringa.containers::SuperViewStack/get selectedChild()[F:\Flex 3\src\com\rubenswieringa\containers\SuperViewStack.as:486]
at com.rubenswieringa.containers::SuperViewStack/set selectedIndex()[F:\Flex 3\src\com\rubenswieringa\containers\SuperViewStack.as:475]
at com.rubenswieringa.containers::SuperViewStack/childrenCreated()[F:\Flex 3\src\com\rubenswieringa\containers\SuperViewStack.as:128]
at mx.core::UIComponent/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5382]
at mx.core::Container/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2569]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5278]
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChild()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:3819]
at mx.core::ContainerRawChildrenList/addChild()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\ContainerRawChildrenList.as:143]
at com.rubenswieringa.book::PageManager/createChildren()[F:\Flex 3\src\com\rubenswieringa\book\PageManager.as:153]
at mx.core::UIComponent/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5381]
at mx.core::Container/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2569]
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5278]
at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:3348]
at mx.core::Container/addChildAt()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2260]
at revista/paginasInHandler()[F:\Flex 3\src\revista.mxml:68]
at revista/__fechaPHP_result()[F:\Flex 3\src\revista.mxml:168]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\http\HTTPService.as:763]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:263]
at mx.rpc::Responder/result()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:46]
at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74]
at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:409]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
a seguir googleando no hay mas...