Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #21  
Old 04-10-2008, 05:50 PM
virgil_disgr4ce virgil_disgr4ce is offline
Junior Member
 
Join Date: Apr 2008
Posts: 11
Downloads: 0
Uploads: 0
Default

Whoa wow, this is crazy. The first thing I had tried WAS to put that code in an actual external plugin but then Zleifr said NOT to do that... I will check into addExternal, but just tell me: in this situation (with a wrapper .swf and dynamically loaded FPP, where I need the FPP .swf to call a function in the wrapper), do I use the separate confinoPlugin.swf or not? Thanks again so much guys!

--Ted
Reply With Quote
  #22  
Old 04-10-2008, 06:32 PM
cheathamlane cheathamlane is offline
Senior Member
 
Join Date: Mar 2007
Location: California, USA
Posts: 773
Downloads: 0
Uploads: 0
Default

I may stand corrected... someone hit me up off-list to let me know that you _can_ init your container/wrapper (embedPano style) as a plugin.

There you go... Cool. I learned something new.

I bet that you're having issues simply because of timing. In your embedPano container, monitor the pano.swf/pano loading, and init your container as a plugin once you're certain that the hotspots are "ready". You may be trying to init your container too soon, and so it's not showing up.
__________________
Patrick
http://patrickcheatham.com
Reply With Quote
  #23  
Old 04-17-2008, 01:22 AM
virgil_disgr4ce virgil_disgr4ce is offline
Junior Member
 
Join Date: Apr 2008
Posts: 11
Downloads: 0
Uploads: 0
Default

OK, so, I'm still stumped on this one. Does anyone have an actual working implementation of this, or an example? Anyone? That would be fantastic
Reply With Quote
  #24  
Old 04-17-2008, 06:05 PM
FischMich FischMich is offline
Junior Member
 
Join Date: Nov 2007
Posts: 1
Downloads: 0
Uploads: 0
Default

hi virgil_disgr4ce,

i had the same prob. you may try it out with the following init function:


function init (panoMain:Object=null) {
panoMain.addExternal(this);
panoMain.externals.confinoPlugin = this;
}

greetz,
mikee

Last edited by FischMich; 04-22-2008 at 05:12 PM.
Reply With Quote
  #25  
Old 05-07-2008, 08:56 PM
vipergtsrz vipergtsrz is offline
Junior Member
 
Join Date: May 2008
Posts: 5
Downloads: 0
Uploads: 0
Default

I'm with virgil here. I just read this entire thread, and I'm more confused then when I started.

Can someone post a zip file with a working project?

All I want to do is have this in my XML:

Code:
<spot id="simpleHotspot" pan="-110" tilt="-17" url="hot.png" onClick="playSound();" />
and in my flash I have a function like this:
Code:
function playSound() {
	trace("ejhfefiojwiowejfiwojifeofj");
}
I just want to see that trace come up when I click on the hotspot. This what I get on my trace:

Code:
Execute simplehotspot: playSound()
Unrecognized object: playSound
It's really a very simple request. How can we call a flash function by clicking on a hotspot. How would this not be the most used thing with a flash panoramic?
Reply With Quote
  #26  
Old 05-07-2008, 09:20 PM
virgil_disgr4ce virgil_disgr4ce is offline
Junior Member
 
Join Date: Apr 2008
Posts: 11
Downloads: 0
Uploads: 0
Default

Thanks for the backup Viper... surely SOMEONE must have gotten this to work??
Reply With Quote
  #27  
Old 05-07-2008, 09:36 PM
cheathamlane cheathamlane is offline
Senior Member
 
Join Date: Mar 2007
Location: California, USA
Posts: 773
Downloads: 0
Uploads: 0
Default

You have several options available to you.

* You can use ExternalInterface, and have your hotspot call a Javascript function which would then operate on your loaded SWF. See the FPP docs and/or Flash docs for info on ExternalInterface. Also reference the externalTest.fla and example HTML/XML which come with FPP.

* You can use LocalConnection instead of ExternalInterface (ditto above, and reference the controller.fla which comes with FPP).

* You can script your SWF in such a way that it will register itself as a plugin for FPP. Then, you can call out to your swf from a hotspot directly, a la something like: external.myCoolPlugin.someVariable=someValue. (see link farther down in this post for info).

The glassMeter.fla which comes with FPP is a good example of this. It has all the code you need -- minus some string parsing, maybe -- to make your own plugin.

Note that the newParams function is what reads in values from the XML element named <myCoolPlugin/> (as in <autorotator>speed=5</autorotator>) when your FPP presentation first loads. For an example of using newParams for string parsing, see the openFullscreen.fla which comes with FPP.

Also see the flvplayer.fla which comes with FPP. This shows how to have a SWF you load as a hotspot react to mouse events.

--
The setAttribute function is what you will need in your plugin SWF, so that it can react to calls from hotspots (a la external.myCoolPlugin.someVariable=someValue).

See the post (or search the forums for "cheatsheet") at: http://flashpanoramas.com/forum/showthread.php?t=581

The tools are all at your disposal, from FPP example FLAs and posts here in the forum.

Quote:
How would this not be the most used thing with a flash panoramic?
Hmmm... Well, FPP is pretty darned powerful right out of the box -- You can do a lot with just the plugins provided, and with the functionality in the XML as it is.
__________________
Patrick
http://patrickcheatham.com

Last edited by cheathamlane; 05-07-2008 at 09:50 PM. Reason: added fla names; fixed typo
Reply With Quote
  #28  
Old 05-07-2008, 09:57 PM
vipergtsrz vipergtsrz is offline
Junior Member
 
Join Date: May 2008
Posts: 5
Downloads: 0
Uploads: 0
Default

Thanks for taking the time to response cheathamlane.

I just got introduced to "FFP" (I don't even know what FFP stands for) today by my boss. He wants me to make hotspots do things like play sounds or show text, etc when clicked. My company is looking to build a virtual tour of our locations and I just started looking through the tutorials today.

I guess what I don't get is this. In the tutorial, it says this:

Quote:
You can set any number of functions for any object. Use unique function names for your own functions (like moveToTheNextHotspot and showNavigationButtons) or use one of predefined event identifiers (onClick, onLoad, onTransitionStart) if you want your function be called with some event.

To execute commands stored in the function, use [function name](). To call function described in another object, use [object name].[function name]():
That's where I'm lost. In the example he gives, it says I can use this
Code:
openUrl(http://flashpanoramas.com/)
or

Code:
loadPano(nextPano.swf)
in the onClick property. Both of these work for me. When I click on the hotspot it loads a new panorama or goes to a URL in a browser.

It appears like there are some predefined functions (like loadPano()) that I can call with no problem, but I can't just make my own functions. Is there a list somewhere of all the predefined functions that I can call like loadPano()?

You mention making me SWF into a plugin itself. I just don't see why someone could go through the trouble to make an SWF plugin just so they can call a basic function that's already found in the SWF that's calling the pano in the first place.

I don't want to use ExternalInterface because I'm not wanting to call an external JavaScript function. I want to call a function that resides in the SWF actionscript. I can't even call a trace("hello world") when I click on it. Why?

I am all for applications being "pretty darned powerful", but sometimes having all the features in the universe don't make up for usability. If something isn't easy to use, you end up spending hours figuring out how to do something rather basic.
Reply With Quote
  #29  
Old 05-07-2008, 10:19 PM
cheathamlane cheathamlane is offline
Senior Member
 
Join Date: Mar 2007
Location: California, USA
Posts: 773
Downloads: 0
Uploads: 0
Default

Hey there:

No worries, and sure, there's a learning curve. FPP = Flash Panorama Player.

* Making plugins: You're absolutely right, making one just so you can call a function that duplicates existing functionality would be a waste of effort. (But, the original post in this thread, I believe, was about doing something different).

* Predefined functions: Yes -- in the same documentation with the info you just quoted! From the "tutorials.html" file in the FPP documentation, follow the link to "Hotspots plugin". From there you'll see a slew of info regarding things like pan, tilt, scale, visible, openUrl, etc. These are all things you could put in (say) an onClick event a la onClick="pan=20;someHotspotID.visible=0;".

* Custom functions: In a spot you could put a line that says myCoolFunction="pan=20;". Then in the same spot you could put onClick="myCoolFunction;". Make sense? I go over custom functions and how to write them & access them over at http://flashpanos.com/content/simple...o-presentation with a more complex example.

* ExternalInterface: Well, you could use it to call directly to your SWF, too rather than to Javascript. I think your <spot> would need to have a SWF in it which called ExternalInterface. I've only used EI to go from my SWF to FPP and not the other way around.

* One way to do a sound might be to make a hidden spot that is the (for example) "mySound.swf". Then, you could have a different spot call something like onClick="mySoundSpot.url=mySound.swf?playsound" or onClick="mySoundSpot.url=aCoolSound.swf"

?

HTH,
__________________
Patrick
http://patrickcheatham.com
Reply With Quote
  #30  
Old 05-08-2008, 04:10 AM
zleifr's Avatar
zleifr zleifr is offline
Senior Member
 
Join Date: May 2007
Posts: 609
Downloads: 0
Uploads: 0
Default

vipergtsrz:

I have already explained this above, but maybe I can try and rephrase. In the XML you can write "FPP functions", which are nothing more than text which FPP analyses and knows how to convert into actionscript. FPP functions are NOT NOT NOT actionscript, although, superficially, they do resemble them.

IF you want to be able to access an actionscript function by using a command in the XML, you have to direct the analysis and conversion of the text to actionscript code that you have written in a plugin, or an "embedPano" wrapper. The way the command is directed to the plugin is simple: external.plugin_name.property=value. When this command is executed, FPP looks for a plugin that is registered under the appropriate name, and then calls the setAtttribute function in the plugin, with two arguments: property and value. From there you are responsible for analysing those two pieces of information and directing execution to the proper place. (If statements are very handy for this).

Notice that above I did not say that it has to be a plugin that handles this call, it only has to be an entity that has registered itself as a plugin with FPP and has the required variables and functions that FPP calls as though it were a plugin. Therefore, an embedPano "wrapper" can be registered as a function, and consequently receive communication from the XML layer. The corollary to this is that plugins do not HAVE to be loaded via the layer_n = blah directives in the XML; anything that has the required variables and functions of a plugin and registers itself as such with FPP is a plugin as far as FPP is concerned.

Zephyr
__________________
Zephyr Renner - AdvancedVirtualTours.com - zleifr @t yahoo

Improving the panoramic one mighty fine plug-in at a time: http://www.flashpanos.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 01:05 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.