Copy link to clipboard
Copied
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!!
Copy link to clipboard
Copied
What is the folder structure for the various files involved, and how does the flipping page file target whatever files it loads?
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Is the flipping swf an AS2 file or an AS3 file?
Copy link to clipboard
Copied
AS 2...
Copy link to clipboard
Copied
If the AS2 file uses _root references, then that might be the source of the problem. Does it?
Copy link to clipboard
Copied
I don't really know, where would I look for that? I only have the swf file and XML...
Copy link to clipboard
Copied
If you only have the swf, then as far as I know you will not be able to do much to resolve your problem (someone else may know further). Chances are the AS2 file is using _root references, which has it looking to the file that loads it as the _root... which is not what is intended. If it's using _root references it is not designed to be loaded into another file.
If you could edit the AS2 file you might be able to fix it by setting its _lockroot property to be true. Or if the file loading it was an AS2 file you could set its _lockroot property from there after it was loaded. But _lockroot is not part of the AS3 language, so you can't set it in the AS3 file like you could if the main file was an AS2 file.
Copy link to clipboard
Copied
Thanks a lot man, I'm gonna look for another solution!!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more