Author Topic: Unable to add swf 360 degree panoramics to book  (Read 1180 times)

gingerwinger

  • Newbie
  • *
  • Posts: 9
Unable to add swf 360 degree panoramics to book
« on: January 05, 2011, 02:33:28 pm »
Hi

Hopefully someone can help as I' tearing my hair out with this.  I have followed all the tutorials on how to add movies and images to a book and am getting there slowly as I am not a programmer.  I am trying to add panoramics to the book but the swf does not show! I can change the swf to a movie swf and it works but I can add the panoramics.

I want to create a book so people can view scenes 360 degree whilst still in the brochure.  This has been done via using the Megazine3 but for the life of me I can't work out how to implement them.  A previous post was set up and the question was asked to no avail!

http://www.megazine3.de/forum/index.php/topic,995.msg3806.html#msg3806

Please someone help before I go bald!  :D

Many thanks

Dan

willee27

  • Newbie
  • *
  • Posts: 14
Re: Unable to add swf 360 degree panoramics to book
« Reply #1 on: January 05, 2011, 10:01:27 pm »
Maybe this extract from the .mz3 file out of the french example  could give you an idea how to.


"
Quote
<spreadpage foldfx="0" anchor="01_2010_1" buffer="false" buffer_aa="false" buffer_animate="false" stiff="false" delay="0" fade="2000">
  <snd src="../data/fr/panos/01_2010_1/media/sound.mp3" onlywhenactive="true" left="0" priority="15" top="0" delay="2000" fade="2000" loop="true" restart="false" />
  <img src="../data/fr/loaderPano.swf?num=01_2010_1" cache="false" left="0" top="0" priority="10" aa="false" allowbmpcaching="true" height="auto" keepar="false" rasterize="false" sameappdomain="false" samesecdomain="false" width="auto" target="_blank" />
  <img src="../data/fr/legendes/01_2010_legende_1.jpg" left="0" top="553" priority="10" aa="false" allowbmpcaching="true" cache="true" height="auto" keepar="false" rasterize="false" sameappdomain="false" samesecdomain="false" width="auto" target="_blank" />
  </spreadpage>
"
The file is located at

http://www.regionalesbretagneenimages.fr/megazine/megazine.mz3


But I doubt copying that spreadpage will not do.
Some more Javascript then the usual will be needed to make it work i think.(cfr the parameters with the panoramic files, do they really belong to megazine3?
I am a newbie an just trying to help.

gingerwinger

  • Newbie
  • *
  • Posts: 9
Re: Unable to add swf 360 degree panoramics to book
« Reply #2 on: January 06, 2011, 02:33:55 pm »
Thank you for your post I really appreciate your assistance! :-)

The url they are using... <img src="../data/fr/loaderPano.swf?num=01_2010_1"  is a link direct to the panoranic flash player enabling the panoramic to be viewed.

I gathered this was something which was stopping me from viewing the panoramic image so I bought one which can be used also.  I is called Pano Flip Spot Panarama Player but I am having difficulty implementing it in the Megazine book.  The code for it looks like this...

<spot type ="pano" url="../Pano/PFB_Spot_Panorama_Player.swf?pano=cubes/wieza_okragla/cube&x=20&y=20&width=300&height=300&auto=true"/>

I have changed the code to test it with <img> and <vid> tags to no avail.  I'm wondering if there is any JS or alterations needed to get it working! I too am a novice, infact what's worse than a novice as that's me! lol

Look forward to any comments and thanks again

Dan

willee27

  • Newbie
  • *
  • Posts: 14
Re: Unable to add swf 360 degree panoramics to book
« Reply #3 on: January 07, 2011, 10:52:40 am »
You can downmoad the loaderPano.swf - file from the following  location and give it a try.
http://www.regionalesbretagneenimages.fr/data/fr/loaderPano.swf?num=01_2010_1
Good luck!

gingerwinger

  • Newbie
  • *
  • Posts: 9
Re: Unable to add swf 360 degree panoramics to book
« Reply #4 on: January 07, 2011, 12:42:25 pm »
You can downmoad the loaderPano.swf - file from the following  location and give it a try.
http://www.regionalesbretagneenimages.fr/data/fr/loaderPano.swf?num=01_2010_1
Good luck!

Thanks for that but the swf file you have pointed me to does nothing plus also the software is licensed so really shouldn't be getting it off people who have paid for it.  Also that program is not suitable for my needs as I need to add more than one pano onto a page and the program I have bought does.  The issue is getting the damn thing to work! lol The coding is different to Megazine so not sure the best way to alter it so it works.  I have tried every combination I know with my limited knowledge to no avail.

Not sure if I need to alter something somewhere else or its just simply the case I enter the url as described but this doesn't work.

Slowly getting a bald patch! :-)

Thanks for your help, its appreciated

gingerwinger

  • Newbie
  • *
  • Posts: 9
Re: Unable to add swf 360 degree panoramics to book
« Reply #5 on: January 07, 2011, 05:08:23 pm »
Right further development...

I have contacted the author of the Panoranic Player I am trying to use and they said I should use this script within the pages:

<img src="../Pano/PFB_Spot_Panorama_Player.swf?pano=../Pano/cubes/wieza_okragla/cube&x=20&y=20&width=150&height=150"/>

He also said I should turn off the enterframe handlers or it will kill the book.  How do I do that if at all possible?

This should allow me to place panoramics on the pages, fingers crossed, otherwise my computer will be flying out of the window! lol

Please help.....  :-)

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: Unable to add swf 360 degree panoramics to book
« Reply #6 on: January 09, 2011, 03:42:24 am »
There were some issues with panorama viewers before, which were mainly caused by the fact that those viewers often assumed they were the "topmost" element, and allowed to use the entire stage. The parameters in your snippet (the src="path?...&width=150&height=150" would lead one to assume this one can be told to only use a certain size, which should solve *that* problem).
As for the enterframe handlers... I can only guess here, but the viewer probably uses some per-frame-updating. Which the author (correctly so!) recommended you to disable (at least while the page is not visible, I guess). How you do that however, I do not know. Maybe it's enough if the viewer is removed from stage, in which case you wouldn't have to do anything, as invisible pages are removed from stage anyway, for performance's sake.
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

gingerwinger

  • Newbie
  • *
  • Posts: 9
Re: Unable to add swf 360 degree panoramics to book
« Reply #7 on: January 10, 2011, 10:54:18 am »
Thanks for the reply...

Could there be something with the index.html and the settings of the SWFObject as yours points to the megazine/preloader.swf where as the panoramic player points to the player.swf.  Is there a way I can combine both index.html settings so both can work together?

gingerwinger

  • Newbie
  • *
  • Posts: 9
Re: Unable to add swf 360 degree panoramics to book
« Reply #8 on: January 10, 2011, 05:12:50 pm »
Quick Update...

I have managed to play around with this and now I have got a grey strip saying "loading 0%" where the panoramic should be! Once the page loads it disappears but no image is left behind. So near yet so far!!! Any ideas as it looks like I am getting there.  The coding I used which got me there is as follows:

<img width="200" height="100" src="../PFB_Spot_Panorama_Player.swf?pano=Pano/cubes/wieza_okragla/cube&auto=true"/>

I so want this to work as I love the look of the Megazine but it is defeating me!!!

gingerwinger

  • Newbie
  • *
  • Posts: 9
Re: Unable to add swf 360 degree panoramics to book
« Reply #9 on: January 10, 2011, 06:01:12 pm »
There were some issues with panorama viewers before, which were mainly caused by the fact that those viewers often assumed they were the "topmost" element, and allowed to use the entire stage. The parameters in your snippet (the src="path?...&width=150&height=150" would lead one to assume this one can be told to only use a certain size, which should solve *that* problem).
As for the enterframe handlers... I can only guess here, but the viewer probably uses some per-frame-updating. Which the author (correctly so!) recommended you to disable (at least while the page is not visible, I guess). How you do that however, I do not know. Maybe it's enough if the viewer is removed from stage, in which case you wouldn't have to do anything, as invisible pages are removed from stage anyway, for performance's sake.

Apparently to remove enter frame handlers I need to call the panorama object directly.  How do I do that?

gingerwinger

  • Newbie
  • *
  • Posts: 9
Re: Unable to add swf 360 degree panoramics to book
« Reply #10 on: January 11, 2011, 06:08:03 pm »
Is there anybody out there that can help?...  :'(

I am now at the stage with the business that I need to implement a solution of adding panoramics to a book ASAP. I am unable to do it with Megazine then I will have to admit defeat and try another provider.  I have got this working on another provider but the design and features are not as good as Megazine.  Not really sure how long to hold on before I can work this out. I so want this to work with Megazine as I love everything about it, apart from this problem of course! lol

I have spent a whole week and many hours looking at this to no avail. I have run out of ideas so maybe its time to move on reluctantly unless an angel pops up from somewhere to assist  :D

globule22

  • Jr. Member
  • **
  • Posts: 40
Re: Unable to add swf 360 degree panoramics to book
« Reply #11 on: January 29, 2012, 11:40:51 am »
Hi gingerwinger,
I coming back to megazine for testing it on iPad and try to take few minutes to help you.
The loaderPano.swf in just a fla for loading FPP panorama player in Megazine engine, a proxy to be clear.

Here is the source code if can help you:

Code: [Select]
import de.mightypirates.megazine.interfaces.*;
import de.mightypirates.megazine.elements.AbstractElement;
//import de.mightypirates.megazine.gui.ILibrary;
import de.mightypirates.megazine.events.*;
import de.mightypirates.megazine.events.PageEvent;
import de.mightypirates.utils.events.*;

import _as.fla.events.LEC;

import flash.events.Event;

//import GuardBunny;
//GuardBunny.mode = GuardBunny.URL_STRING;
//GuardBunny.test("regionalesbretagneenimages.fr", loaderInfo);

var numPano:String;
var booShowAide:Boolean = false;
var booPanoLoaded:Boolean = false;
var panoController:Object=null;
var myConteneur:Sprite = new Sprite();

if(root.loaderInfo.parameters.num)
{
numPano = root.loaderInfo.parameters.num;
}

var myLocalData:SharedObject;

var panorama:MovieClip;
var pageNumber:int;
var pageNumberDem:int;
var mz:IMegaZine;
var isClick:Boolean;
var lec:LEC = new LEC();
var myDragHandler:*;
var t:Timer = new Timer(500,1);
var tHandleDragDown:Timer = new Timer(500);

var pageSide:IPageSide;

var loader:Loader = new Loader();
loader.load(new URLRequest("./data/fr/files/pano.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
addChild(loader);

function loadComplete (e:Event) {
t.addEventListener(TimerEvent.TIMER, initComplete);
t.start();
}

function loadCompleteReload (e:Event) {
t.addEventListener(TimerEvent.TIMER, initCompleteReload);
t.start();
}

/*
PRECHARGEMENT DES FACES DE CUBES
*/

var toCache:Array = new Array();
var preloader:Loader;

function startCache()
{
var _loc_1:URLRequest;
    if (toCache[0] != null)
{
_loc_1 = new URLRequest(toCache[0]);
preloader = new Loader();
preloader.contentLoaderInfo.addEventListener(Event.COMPLETE, preloadcompleted);
preloader.load(_loc_1);
               
    }
return;
}

function preloadcompleted(param1:Event) : void
{
toCache.shift();
startCache();
return;
}

/*
PRECHARGEMENT DES FACES DE CUBES
*/

function initComplete (e:Event)
{
t.stop();
}


function initCompleteReload(e:Event)
{
panorama = ( loader.content as MovieClip );
panorama.setArea(0,0,900,600);
panoController = panorama;
panorama.loadPanorama("xml_file=./data/fr/pano_"+numPano+".xml");
t.stop();
}

function handleDragDown()
{
//t.addEventListener(TimerEvent.TIMER, initCompleteReload);
//t.start();
this.addEventListener(MouseEvent.MOUSE_DOWN,handleDragDownEvent);
this.addEventListener(MouseEvent.MOUSE_UP,handleDragUpEvent);
}

function handleDragDownEvent(e:Event)
{
if(mouseX<75)
{
if(panoController.externals.autorotator != null)
{
panoController.externals.autorotator.disabled = 1;
}
}
}

function handleDragUpEvent(e:Event)
{
if(mouseX<75)
{
if(panoController.externals.autorotator != null)
{
panoController.externals.autorotator.disabled = 0;
}
}
}

// INIT

function megazineSetup(mz:*, page:*):void
{
pageNumber = page.number + (page.number & 1);
pageNumberDem = pageNumber;

pageSide = mz.getPageSide(pageNumber);

/*
if (pageSide.state == Constants.PAGE_SIDE_STATE_LOADED) {
// loaded, do stuff
//doStuffForPageside(pageside);
} else {
pageSide.addEventListener(StateChangeEvent.STATE_CHANGE, handleStateChange, false, 0, true);
}
*/

pageSide.addEventListener(VisibilityEvent.VISIBLE, handleVisible, false, 0, true);
    // Remove if unnecessary.
    pageSide.addEventListener(VisibilityEvent.INVISIBLE, handleInvisible, false, 0, true);
 
    // Initial check if page is already visible
    if (pageSide.visible) {
        handleVisible(null);
    } else {
        handleInvisible(null);
    }


//mz.addEventListener("page_change", handlePageChange, false, 0, true);

mz.addEventListener(DragAreaEvent.DRAG_AREA_OVER,myhandleDragAreaOver,false, 0, true);
mz.addEventListener(DragAreaEvent.DRAG_AREA_OUT,myhandleDragAreaOut,false, 0, true);

myLocalData = SharedObject.getLocal("isClick");

toCache.push("./data/fr/panos/"+numPano+"/pano_f.jpg");
toCache.push("./data/fr/panos/"+numPano+"/pano_r.jpg");
toCache.push("./data/fr/panos/"+numPano+"/pano_b.jpg");
toCache.push("./data/fr/panos/"+numPano+"/pano_l.jpg");
toCache.push("./data/fr/panos/"+numPano+"/pano_u.jpg");
toCache.push("./data/fr/panos/"+numPano+"/pano_d.jpg");
startCache();

}

function handleVisible(e:Event):void {
   //if(!booPanoLoaded)
   //{
    panorama = new MovieClip();
if(loader.content)
{
//trace("loader.content: "+loader.content);
panorama = ( loader.content as MovieClip );
panorama.setArea(0,0,900,600);
panoController = panorama;
panorama.loadPanorama("xml_file=./data/fr/pano_"+numPano+".xml");
if(!myLocalData.data.isClick)
{
showAide();
}
booPanoLoaded = true
}
else
{
loader.load(new URLRequest("./data/fr/files/pano.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteReload);
}
   //}
}
 
// Remove if unnecessary.
function handleInvisible(e:Event):void {
    // Now invisible.
    if(panorama)
{
if(panoController)
{
panoController.externals.autorotator.disabled = 1;
panorama.pano.remove();
panorama.pano = null;
panorama = null;
if(loader)
{
loader.unload();
}

System.gc();
System.gc();

if(mz)
{
//mz.removeEventListener("page_change", handlePageChange);
}
}
}
}

function handleStateChange(e:StateChangeEvent):void {
if(pageNumber == pageNumberDem)
{
if (e.newState == "page_side_state_loaded") {
// now loaded
var pageside:IPageSide = IPageSide(e.currentTarget); // or e.target, I never know...
pageside.removeEventListener(StateChangeEvent.STATE_CHANGE, handleStateChange);
//doStuffForPageside(pageside);
demarrageDirect();
}
}
}


function ecouteur(e:*):void
{
trace("DOWN...");
}

function myhandleDragAreaOver(e:*):void
{
if(panoController != null && panoController.externals != null)
{
if(panoController.externals.autorotator != null)
{
panoController.externals.autorotator.disabled = 1;
}
}
}

function myhandleDragAreaOut(e:*):void
{
//si drag en dehors ???

if(panoController != null && panoController.externals != null)
{
if(panoController.externals.autorotator != null)
{
panoController.externals.autorotator.disabled = 0;
}
}
}

//handlePageChange(null);

function handlePageChange(e:*):void
{
//trace("handlePageChange...");
pageNumber = e.newPage;
if(e.newPage==pageNumber)
{
//trace("page main visible: "+numPano);
panorama = new MovieClip();
if(loader.content)
{
//trace("loader.content: "+loader.content);
panorama = ( loader.content as MovieClip );
panorama.setArea(0,0,900,600);
panoController = panorama;
panorama.loadPanorama("xml_file=./data/fr/pano_"+numPano+".xml");
if(!myLocalData.data.isClick)
{
showAide();
}
}
else
{
loader.load(new URLRequest("./data/fr/files/pano.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteReload);
}

}
else if (e.oldPage == pageNumber)
{
if(panorama)
{
if(panoController)
{
panoController.externals.autorotator.disabled = 1;
panorama.pano.remove();
panorama.pano = null;
panorama = null;
if(loader)
{
loader.unload();
}

System.gc();
System.gc();

if(mz)
{
mz.removeEventListener("page_change", handlePageChange);
}
}
}
}
}

function demarrageDirect():void
{
//trace("demarrageDirect...");
//trace("page main visible: "+numPano);
panorama = new MovieClip();
if(loader.content)
{
//trace("loader.content: "+loader.content);
panorama = ( loader.content as MovieClip );
panorama.setArea(0,0,900,600);
panoController = panorama;
panorama.loadPanorama("xml_file=./data/fr/pano_"+numPano+".xml");
if(!myLocalData.data.isClick)
{
showAide();
}
}
else
{
loader.load(new URLRequest("./data/fr/files/pano.swf"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteReload);
}
}

function showAide()
{
if(!booShowAide && !isClick)
{
booShowAide = true;

myConteneur.addChild(fondAide);
myConteneur.addChild(aide);
aide.x = 0;
aide.y = 0;
addChild(myConteneur);

myConteneur.x = 290;
myConteneur.y = 270;

addEventListener(MouseEvent.MOUSE_DOWN, doDownAide);
}
}

var myFont:Font = new Futura();
//myFont.registerFont(Futura);

var fondAide:Shape = new Shape();
fondAide.graphics.beginFill(0x999999);
fondAide.graphics.drawRect(0, 0, 320, 60);
fondAide.alpha = 0.35;

/*
var myFormat:TextFormat = new TextFormat();
myFormat.size = 25;
myFormat.color = 0xffffff;
myFormat.bold = true;
myFormat.font = myFont.fontName;
myFormat.align = TextFormatAlign.CENTER;

var monAide:TextField = new TextField();
with(monAide)
{
    x = 8; //coordonnée x
    y = 10; //coordonnée y
    defaultTextFormat = myFormat;
    autoSize = TextFieldAutoSize.LEFT; //largeur et hauteur automatique à partir du bord gauche
    selectable = false; // Le texte ne peut pas être sélectionné
    text = "Glisser / Déplacer l'image"; // Contenu du champ de texte
}
*/
function setRegistrationPoint(s:Sprite, regx:Number, regy:Number, showRegistration:Boolean )
{
    //translate movieclip
    s.transform.matrix = new Matrix(1, 0, 0, 1, -regx, -regy);
   
    //registration point.
    if (showRegistration)
    {
        var mark:Sprite = new Sprite();
        mark.graphics.lineStyle(1, 0x000000);
        mark.graphics.moveTo(-5, -5);
        mark.graphics.lineTo(5, 5);
        mark.graphics.moveTo(-5, 5);
        mark.graphics.lineTo(5, -5);
        s.parent.addChild(mark);
    }
}

function doDownAide (event:MouseEvent) {
removeChild(myConteneur);
//booShowAide = false;
myLocalData.data.isClick = "true";
myLocalData.flush();
removeEventListener(MouseEvent.MOUSE_DOWN, doDownAide);
}

Regards