Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/05/2011, 09:16
Avatar de superscully
superscully
 
Fecha de Ingreso: febrero-2009
Mensajes: 56
Antigüedad: 15 años, 3 meses
Puntos: 0
Busqueda Respuesta: crear un book dinamico con libreria

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 original
  1. private function paginasInHandler(event:ResultEvent):void
  2.         {
  3.             var tmp:XMLList = new XMLList(event.result);
  4.             revista = new XMLList(tmp.galeria.node);
  5.             imgPaginas = new ArrayCollection();
  6.             var libro:Book = new Book();
  7.             libro.width=500;
  8.             libro.height=300;
  9.             libro.openAt=0;
  10.             libro.autoFlipDuration=500;
  11.             libro.easing=0.7;
  12.             libro.regionSize=150;
  13.             libro.sideFlip=true;
  14.             libro.hardCover=true;
  15.             libro.hover=true;
  16.             libro.snap=false;
  17.             libro.flipOnClick=true;
  18.             //libro.tearable=true;
  19.             var pagina:Page = new Page();
  20.             pagina.tearable=true;
  21.             libro.addChildAt(pagina,0);
  22.             for(var i:int=0;i<periodico.length();i++)
  23.             {
  24.                 imgPaginas.addItem({source:"http://localhost/thumbs/"+periodico[i].@id+".jpg"});
  25.                 var img:Image = new Image();
  26.                 img.source="http://localhost/thumbs/"+revista[i].@id+".jpg";
  27.                 pagina.addChildAt(img,i);
  28.                 libro.addChildAt(pagina,i);
  29.             }
  30.             stage2.addChildAt(libro,0);
  31.         }

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
  1. <mx:Canvas width="100%" height="100%" left="0" top="80" id="stage2" visible="true" backgroundColor="#F5B366">
  2. </mx:Canvas>


y me genera este error, no se que como puedo corregirlo:
Código Error:
Ver original
  1. RangeError: Error #2006: El índice proporcionado está fuera de los límites.
  2.     at flash.display::DisplayObjectContainer/getChildAt()
  3.     at mx.core::Container/getChildAt()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2377]
  4.         at com.rubenswieringa.containers::SuperViewStack/get selectedChild()[F:\Flex 3\src\com\rubenswieringa\containers\SuperViewStack.as:486]
  5.     at com.rubenswieringa.containers::SuperViewStack/set selectedIndex()[F:\Flex 3\src\com\rubenswieringa\containers\SuperViewStack.as:475]
  6.     at com.rubenswieringa.containers::SuperViewStack/childrenCreated()[F:\Flex 3\src\com\rubenswieringa\containers\SuperViewStack.as:128]
  7.     at mx.core::UIComponent/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5382]
  8.     at mx.core::Container/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2569]
  9.     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]
  10.     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]
  11.     at mx.core::ContainerRawChildrenList/addChild()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\ContainerRawChildrenList.as:143]
  12.     at com.rubenswieringa.book::PageManager/createChildren()[F:\Flex 3\src\com\rubenswieringa\book\PageManager.as:153]
  13.     at mx.core::UIComponent/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5381]
  14.     at mx.core::Container/initialize()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2569]
  15.     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]
  16.     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]
  17.     at mx.core::Container/addChildAt()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\Container.as:2260]
  18.     at revista/paginasInHandler()[F:\Flex 3\src\revista.mxml:68]
  19.     at revista/__fechaPHP_result()[F:\Flex 3\src\revista.mxml:168]
  20.     at flash.events::EventDispatcher/dispatchEventFunction()
  21.     at flash.events::EventDispatcher/dispatchEvent()
  22.     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]
  23.     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]
  24.     at mx.rpc::Responder/result()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:46]
  25.     at mx.rpc::AsyncRequest/acknowledge()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:74]
  26.     at DirectHTTPMessageResponder/completeHandler()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:409]
  27.     at flash.events::EventDispatcher/dispatchEventFunction()
  28.     at flash.events::EventDispatcher/dispatchEvent()
  29.     at flash.net::URLLoader/onComplete()

a seguir googleando no hay mas...

Última edición por superscully; 16/05/2011 a las 09:17 Razón: me equivoque en la direccion