trying to integrated Megazine page Flip in krpano

  • Hi,
    I am trying to use a page-flip plugin inside krpano and I get an Errorcode:
    "data: Error #2032"
    is this from krpano?
    if yes what does it mean

    Thanks a lot
    Mario

    Edited once, last by mario (October 20, 2009 at 9:48 PM).

  • perhaps the plugin doesn't work with krpano? I don't know:
    The megazine page flip you can find here: http://megazine.mightypirates.de/?c=home&l=en
    My xml:
    <krpano version="1.0.8">

    <include url="global.xml" /> <!--only control-buttons-->


    <preview type="sphere" url="%SWFPATH%/preview/innenhofpreview.jpg" details="10" />


    <image type="CUBE">
    <left url="pano/innenhof_l.jpg" />
    <front url="pano/innenhof_f.jpg" />
    <right url="pano/innenhof_r.jpg" />
    <back url="pano/innenhof_b.jpg" />
    <up url="pano/innenhof_u.jpg" />
    <down url="pano/innenhof_d.jpg" />
    </image>


    <plugin name="showgallery" url="files/showgallery.png" origin="left" edge="center" y="280" x="120" visible="true" alpha="1" autoscale="180,180"
    onclick="action(showgallery);"
    onover=""
    onout=""
    onhover="showtext(klicken zum Einblenden der Fotogalerie);"/>

    <plugin name="hidegallery" url="files/hidegallery.png" origin="left" edge="center" y="280" x="120" visible="false" alpha="1" autoscale="150,150"
    onclick="action(hidegallery);"
    onhover="showtext(klicken zum Schließen der Fotogalerie);"
    />

    <plugin name="gallery" url="" visible="false" alpha="0" zorder="5"/>

    <action name="showgallery">
    freezeview(true);
    set(plugin[showgallery].enable,false);
    tween(plugin[showgallery].alpha,0,distance(1,0.15),,set(plugin[showgallery].visible,false));
    set(plugin[hidegallery].enable,true);
    set(plugin[hidegallery].visible,true);
    tween(plugin[hidegallery].alpha,1,distance(1,0.15));
    set(plugin[gallery].url,megazine.swf?xmlDataPath=megazine.xml);
    set(plugin[gallery].visible,true);
    tween(plugin[gallery].alpha,1,distance(1,0.15));
    tween(image.alpha,0.5);
    </action>

    <action name="hidegallery">
    tween(plugin[gallery].alpha,0,distance(1,0.15),,action(closegallery));
    </action>

    <action name="closegallery">
    set(plugin[gallery].visible,false);
    freezeview(false);
    set(plugin[hidegallery].enable,false);
    tween(plugin[hidegallery].alpha,0,distance(1,0.15),,set(plugin[hidegallery].visible,false));
    set(plugin[showgallery].enable,true);
    set(plugin[showgallery].visible,true);
    tween(plugin[showgallery].alpha,1,distance(1,0.15));
    </action>


    </krpano>

    <!-- Thanks Mario -->

  • Hi,

    perhaps the plugin doesn't work with krpano? I don't know:
    The megazine page flip you can find here: http://megazine.mightypirates.de/?c=home&l=en

    maybe, there many things possible why it couldn't work, needed to be tested...

    set(plugin[gallery].url,megazine.swf?xmlDataPath=megazine.xml);

    where in the MegaZine documentation did you the "xmlDataPath" setting?
    does it load the megazine.xml file or was there already an error before?

    best regards,
    Klaus

  • Hi Klaus,

    definitely it works well outside krpano, the files and directory I have not changed,
    I copied the krpano files with them,
    so here is the as-file, perhaps it helps otherwise let it be....

    __________________________________________________________________________________________
    /*
    * MegaZine3 - Pageflip Engine
    *
    * Copyright (c) 2007-2009, VservU GmbH (Florian Nuecke and Hans J. Nuecke)
    *
    * Permission is hereby granted, free of charge, to any person obtaining a copy
    * of this software and associated documentation files (the "Software"), to deal
    * in the Software without restriction, including without limitation the rights
    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    * copies of the Software, and to permit persons to whom the Software is
    * furnished to do so, subject to the following conditions:
    *
    * The above copyright notice and this permission notice shall be included in
    * all copies or substantial portions of the Software.
    *
    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    * THE SOFTWARE.
    */

    package de.mightypirates.megazine {
    import de.mightypirates.megazine.interfaces.IMegaZine;

    import flash.display.*;
    import flash.events.*;

    /**
    * Main class for building the containing swf...
    *
    * @author fnuecke
    */
    public class Main extends MovieClip {

    // ---------------------------------------------------------------------- //
    //{ region Variables

    /**
    * The megazine object (main part, of course).
    */
    private var megazine_:MegaZine = new MegaZine();

    /**
    * Adjust size of the megazine instance to the available stage size.
    */
    private var fitToStage_:Boolean = false;

    //} endregion
    // ---------------------------------------------------------------------- //


    // ---------------------------------------------------------------------- //
    //{ region Construction

    /**
    * Program entry.
    *
    * <p>
    * Creates the <code>MegaZine</code> instance, checks if this is the root
    * object (i.e. if this SWF was loaded by another one or is the main one),
    * and takes the following steps:
    * <ul>
    * <li>if this is the <b>actual main SWF</b>, sets stage align to top left
    * and stage scale mode to no scale. Furthermore disables some context menu
    * entries (<code>showDefaultContextMenu = false</code>). Adds the MegaZine
    * instance (to this), set <code>fitToStage</code> to <code>true</code>
    * and begins loading.</li>
    * <li>if this is <code>loaded by another SWF</code>, adds the MegaZine
    * instance (to this) and waits until this object is added to the stage
    * (<code>Event.ADDED_TO_STAGE</code>), then begins loading.
    * </ul>
    * </p>
    */
    public function Main() {
    if (stage) {
    // Disable scaling of the content. Hide most entries of the right
    // click menu.
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;
    stage.showDefaultContextMenu = false;

    fitToStage = true;

    init();
    } else {
    // Wait until added to stage.
    addEventListener(Event.ADDED_TO_STAGE, init);
    }
    }

    /**
    * Actual initialization.
    */
    private function init(e:Event = null):void {
    // Only once.
    removeEventListener(Event.ADDED_TO_STAGE, init);

    // Scale?
    if (fitToStage_) {
    // Resizing to fill the available space.
    stage.addEventListener(Event.RESIZE, handleStageResize);
    handleStageResize(null);
    }

    // Add the megazine and the console to the stage.
    addChild(megazine_);

    // Begin loading.
    megazine_.load(stage.loaderInfo.parameters["xmlFile"]);
    }

    //} endregion
    // ---------------------------------------------------------------------- //


    // ---------------------------------------------------------------------- //
    //{ region Accessors

    /**
    * Adjust the size of the MegaZine instance so that it always fills the
    * stage to 100%%. Not that <code>stage.align</code> must be set to
    * <code>StageAlign.TOP_LEFT</code> for this to work. Also,
    * <code>stage.scaleMode</code> should be set to
    * <code>StageScaleMode.NO_SCALE</code>.
    */
    public function get fitToStage():Boolean {
    return fitToStage_;
    }

    /**
    * @private
    */
    public function set fitToStage(newValue:Boolean):void {
    fitToStage_ = newValue;
    if (stage) {
    if (newValue) {
    // Resizing to fill the available space.
    stage.addEventListener(Event.RESIZE, handleStageResize);
    handleStageResize(null);
    } else {
    stage.removeEventListener(Event.RESIZE, handleStageResize);
    }
    }
    }

    /**
    * The actual MegaZine instance.
    */
    public function get megazine():IMegaZine {
    return megazine_;
    }

    //} endregion
    // ---------------------------------------------------------------------- //


    // ---------------------------------------------------------------------- //
    //{ region Event Handling

    /**
    * For liquid scaling, handle stage resize events.
    *
    * @param e
    * unused.
    */
    private function handleStageResize(e:Event):void {
    megazine_.width = stage.stageWidth;
    megazine_.height = stage.stageHeight;
    }

    //} endregion
    // ---------------------------------------------------------------------- //

    }
    } // end package


    _________________________________________________________________________________________


    Thank you very much
    Mario

  • Hi,

    about the code from above,
    it looks fine, but it has one problem:

    Code
    // Begin loading.
     megazine_.load(stage.loaderInfo.parameters["xmlFile"]);

    that means it looks for a "xmlFile" parameter
    but from the first loaded swf (which is the krpano),

    that means this "xmlFile" must be already set in the HTML file,
    e.g.

    Code
    so.addVariable("xmlFile", "megazine.xml");


    or if possible change the as3 code to:

    Code
    megazine_.load(this.loaderInfo.parameters["xmlFile"]);

    and then use in the krpano xml: (xmlFile instead of xmlDataPath)

    Code
    set(plugin[gallery].url,megazine.swf?xmlFile=megazine.xml);

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!