Skip to main content
Participating Frequently
May 13, 2011
Question

Loading a Flipping Book swf into a parent swf file

  • May 13, 2011
  • 1 reply
  • 2816 views

Hello everyone, I hope I can find the answer to my problem here...

I'm trying to load a flipping book swf file inside my flash website and I'm using this code:

var myLoader:Loader = new Loader();

addChild(myLoader);

var url:URLRequest = new URLRequest("catalogue.swf");

myLoader.load(url);

the swf file containing the book loads abut the pages that are linked to an XML file won't. I'm using AS 3 and I have found some answers but they are all in AS 2. Does anyone know how I can make this work? How do I call that XML file?

Thanks!!

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
May 13, 2011

What is the folder structure for the various files involved, and how does the flipping page file target whatever files it loads?

Participating Frequently
May 13, 2011

Hey Ned, thanks for your reply!

inside the main folder, where the main .swf file is I have: catalogue.swf, config.xml and another folder called pages, where all the jpg files are. This is my xml file:

<FlippingBook>

<width>600</width>

<height>400</height>

<scaleContent>true</scaleContent>

<firstPage>0</firstPage>

<alwaysOpened> false </alwaysOpened>

<autoFlip> 50 </autoFlip>

<flipOnClick> true </flipOnClick>

<staticShadowsDepth> 1 </staticShadowsDepth>

<dynamicShadowsDepth> 1 </dynamicShadowsDepth>

<moveSpeed> 2 </moveSpeed>

<closeSpeed> 3 </closeSpeed>

<gotoSpeed> 3 </gotoSpeed>

<flipSound></flipSound>

<pageBack> 0x1C90CB </pageBack>

<loadOnDemand> true </loadOnDemand>

<cachePages> true </cachePages>

   <cacheSize> 4 </cacheSize>

<preloaderType> Progress Bar </preloaderType>

<userPreloaderId></userPreloaderId>

<pages>

<page>pages/page01.jpg</page>

<page>pages/page02.jpg</page>

<page>pages/page03.jpg</page>

<page>pages/page04.jpg</page>

<page>pages/page05.jpg</page>

</pages>

</FlippingBook>

the flipping book works fine when I open it separately, but when added to the main swf, I can flip pages but the actual pages are not there, I think the xml is not being called. I'm looking into the ADDED_TO_STAGE function but I have no idea how to add it to my code...

Thanks a lot!

Ned Murphy
Legend
May 13, 2011

Is the flipping swf an AS2 file or an AS3 file?