PDA

View Full Version : Simple Basic Controller


ecreatures
11-24-2007, 08:41 AM
Hi.
I have a swf button, and I want this button to be able to start and stop the autorotator. I have the swf button showing up in my main panorama. I'm new to Flashpanorama but I know ActionScript. I don't understand how I can target the main panorama autorotator to stop it with the dedicated string : "external.autorotator.disable+=1" any help welcome?

zleifr
11-24-2007, 02:02 PM
look at flvplayer.fla, it has the code in it to get the HOTSPOTS object from a swf loaded into a hotspot. Once you've got hotspots, just use hotspots.execute(external.autorotator.disable+=1);

ecreatures
11-25-2007, 04:17 PM
Thanks for your help…for what I understand, I need to have a init handler in my swf button. In this handler I should have the function that must be executed…I'll try

zleifr
11-25-2007, 06:09 PM
Yes that is right. What is special about this button that it has to be an swf? because the autorotator can easily be start/stopped with a normal spot in the xml....

zleifr
11-25-2007, 06:11 PM
You can actually strip flvplayer down to the structure and where it has the hotspots.execute command, you can just change that to hotspots.execute(external.autorotator.disable+=1);

And that should do it for you

ecreatures
11-25-2007, 06:14 PM
Finally I wrote a local connection script. The connection works but when I trace I cannot get the autorotator to stop…here's my code

function noRotation (e:Event) {
if (masterSlot != null) {
_lc.send(masterSlot, "execute", "external.autorotator.disable+=1");
_lc.send(masterSlot, "execute", "pano.pan_v=0");
_lc.send(masterSlot, "execute", "pano.tilt_v=0");
_lc.send(masterSlot, "execute", "pano.zoom_v=0");

}
}

I tried other function that work, but not this one any Ideas?

ecreatures
11-25-2007, 06:16 PM
Here's what I have in the output screen of my main pano swf :

Execute global: external.autorotator.disable+=1

But no effect, I guess the global is the wrong string of it…

zleifr
11-25-2007, 06:54 PM
I don't see why it would make any difference whether the scope is global or not. To check, just put in a normal hotspot with onClick="external.autorotator.disable+=1"

ecreatures
11-26-2007, 05:47 AM
My button is a swf because I want to have a feedback on the button (eg : various states for the button ->toggle on-off).
If I do a simple hotspot button I can stop the autorotation, but with the same "execut"e string in my swf, I cannot get the autorotator to stop.
In the xml, I don't see where I can determine the scope of a fonction. The localConnectionID i gave to my xml is in the "global" tagM. I don't know wherever I could define the LocalConnectionID to change the scope

zleifr
11-26-2007, 03:12 PM
I don't believe you can change the scope controls called via local connection. You might try the direct call method, which I suggested above, basically notice that flvplayer has an example call to hotspots.execute(), strip it down, so it doesn't have the flvplayer specific stuff and put the autorotator disable call in hotspots.execute().

The other thing you might try, that would be simplest of all, is to use "normal" spots, there are a number of ways to get it to change states. I believe you can change the url and it will load in a new image onClick (as well as disable/enabling the autorotator. The other, failsafe method is to use two spots stacked on each other and just switch the visibility / depth of them onClick.

ecreatures
11-26-2007, 04:57 PM
hi! I started to strip the flvplayer fla…to me the code is pretty confusing as I don't really understand the concept behind the direct call. I'll try to work a little bit more on it, following your advices. To me, as a flashpanoramaplayer noob, the whole framework of fpp is pretty messy (as well as the documentation) and I don't understand why there's no simple way to interact with a swf on the main panorama. :confused:
Thanks for your help anyway