PDA

View Full Version : Flash action scripting - help needed!


adriansalisbury
10-02-2009, 04:16 PM
I've actually got this request at the bottom of another thread but guess it is a bit lost there.

My Flash developer is struggling here integrating into FPP and I wonder if any of you can help.

We are struggling with popups that seem to close but when you leave the scene and then come back to it, every popup you clicked on previously reappears. http://axis.uk-virtualtours.co.uk/development/

After Hans narrowed it down to the popups themselves I got my Flash developer to look at his code and he wonders if there is some kind of 'registry' in a particular scene that remembers which popups to have open, and while I am visually hiding the popup, the scene doesn't know and assumes you want
it open again when you come back?

Here is the code in his swf to close the popup:


close_btn.addEventListener(MouseEvent.CLICK, function (event:MouseEvent):void {
(loaderInfo.loader as Object).parent.visible = false; });

Does anyone understand this that might be able to help us?!?

allSaints
10-02-2009, 10:28 PM
Adrian,

are all those popups hotspots in your pano?


Tommy

adriansalisbury
10-03-2009, 02:54 PM
yes, they are all loaded by clicking a hotspot.

allSaints
10-03-2009, 03:25 PM
So,

the way I make hotspots not visible is always through FPP, not to make anything get out of synch:


// get link to hotspots plugin object:
hotspots = loaderInfo.loader.hotspots;

// set hotspot invisible
hotspots.execute(hotspot_id+".visible=0");



Tommy

adriansalisbury
10-03-2009, 11:00 PM
Sorry, I don't understand where this code would go? Can you show in the XML file please

allSaints
10-03-2009, 11:33 PM
Well, where does the code go that you cited above?

This code is Actionscript - it is supposed to go into your .swf file, not the xml file.

adriansalisbury
10-04-2009, 07:55 AM
Ah, that's why I didn't recognise it.
I have someone doing the swf files for me and he supplied this code. I'll forward your message to him. When you said about making the hotspots not visible through FPP I assumed you were putting this code in the XML. So nothing to add to the XML, just change the code in the SWF to this?

allSaints
10-04-2009, 10:06 AM
Right.

What I meant was, that in your actionscript code you don't turn the hotspots off directly, but instead tell FPP to turn them off. In that way you make shure that FPP knows what is happening.

Tommy