Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Loading a Flipping Book swf into a parent swf file

New Here ,
May 13, 2011 May 13, 2011

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!!

TOPICS
ActionScript
2.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2011 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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2011 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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2011 May 13, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2011 May 13, 2011

AS 2...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2011 May 13, 2011

If the AS2 file uses _root references, then that might be the source of the problem. Does it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2011 May 13, 2011

I don't really know, where would I look for that? I only have the swf file and XML...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2011 May 13, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 13, 2011 May 13, 2011
LATEST

Thanks a lot man, I'm gonna look for another solution!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines