Combo box to pan to hotspot

What's the best approach to add a combo box that pans to a certain point in PanoSalado? I see there's a plugin for FPP, but I don't know if/how to add plugins to PanoSalado.

I've got a panorama going where if I click on a hotspot it brings up a movie clip in a layer on top of the others (PanoDetailViewer), which all works fine, like so:

<PanoSalado>
        <layer id="PanoDetailViewer" url="PanoDetailViewer.swf" depth="2"/>
        <layer id="Interface" url="UserInterface.swf" depth="1"/>
        <layer id="PanoSalado" url="PanoSalado.swf" depth="0">

Then if you click on a hotspot, it calls an event in PanoDetailViewer that fades in a detail view of what I'm looking at, like so:
Inside my XML:

                                <hotspot id="toConcert2fromReggie"
                                        useHandCursor="true"
                                        pan="-82.5"
                                        tilt="11.5"
                                        segments="2"
                                        oneSide="false"
                                        smooth="true"
                                        onClick="dispatchBroadcast:getDetailImage,param1=wjennings,param2=Waylon Jennings"
                                >

                                        <file>graphics/hotspot4.png</file>
                                </hotspot>

Inside PanoDetailViewer:

function goGetDetailImage(e:BroadcastEvent):void
        {
        if (e.info)
                {
                if (currentdetailimage != undefined)
                        {
                        this.removeChild(currentdetailimage);
                        currentdetailimage = undefined;
                        }
                       
                var infoObject:Object = e.info as Object;
                trace(infoObject.param1, infoObject.param2) // ->hello world

                var getMyClass:Class = getDefinitionByName(infoObject.param1) as Class;
       
                var newdetailimage = new getMyClass();
                newdetailimage.name = "thedetailimage";
                newdetailimage.x = detailxposition;
                newdetailimage.y = detailyposition;
                newdetailimage.alpha = 0;
               
                var detailimagetitle:TextField = new TextField();
                detailimagetitle.name = "detailimagetitle";
                detailimagetitle.wordWrap = true;
                //kennedytitle.autoSize = TextFieldAutoSize.LEFT;
                detailimagetitle.width = 370;
                detailimagetitle.height = 100;
                detailimagetitle.defaultTextFormat = detailtitleformat;
                //kennedytitle.embedFonts = true;
                detailimagetitle.textColor = 0xFFFFFF;
                detailimagetitle.text = infoObject.param2;
                detailimagetitle.x = 3;
                detailimagetitle.y = 3;
                newdetailimage.addChild(detailimagetitle);
                //currentdetailimagetitle = this.getChildByName("detailimagetitle");
               
                var newclosebutton = new closebutton();
                newclosebutton.x = 500;
                newclosebutton.y = 3;
                newclosebutton.addEventListener(MouseEvent.CLICK, closeDetailView);
                newdetailimage.addChild(newclosebutton);

                this.addChild(newdetailimage);
               
                currentdetailimage = this.getChildByName("thedetailimage");

                var detailFadeInTween:Tween = new Tween(currentdetailimage, "alpha", Strong.easeInOut, 0, 100, 2, true);
                tweenArray.push(detailFadeInTween);
               
                }
        }
       

Now I'd like to add a combo box that lets me select from a list of hotspots and then pans to that hotspot and brings up the detail view that goes with that hotspot. So essentially it pans to the right spot and fires the same event I have going now.

Seems like the combo box should either go in PanoDetailViewer.swf or in UserInterface.swf, but I'm not sure how to fire a panning event.

Thanks!

__________________

Michael Corey
DesMoinesRegister.com

Re: ComboBox to pan

Hi Michael,

Well that is a multi-multi-part question.

A: Adding ComboBox to pan to location: This is relatively easy. Either in your PanoDetailViewer layer, or in a new layer, put in a combobox, give it a dataProvider with a bunch of strings that are tween commands.

Define a reference to PanoSalado (which you can do with your reference to moduleLoader, using var panoSalado:Object = moduleLoader.layerByName["PanoSalado"];)

And then you will want to use whatever event the combobox fires when a user changes the selected item to call panoSalado.execute() and pass to the execute method the selected tween string.

B: To have PS dispatch an event afterwords, you are going to have to instruction it to do that in the tween string. I don't know if I remember the exact syntax off the top of my head, but it will be something like "tween: ..... then do dispatchBroadcast:myTweenFinished,arg1=something". You are definitely going to be charting new territory here!

Alternately, you could edit PanoSalado.as and add a few lines of code to dispatch a new BroadcastEvent on ModuleLoader every time a tween finishes, and stick the tween string into the info object so that any listener function will know which tween just finished...

Hope that helps,

Zephyr

__________________

Zephyr Renner