Getting and Compiling PanoSalado Source

Well, it is probably high time that I write a mini tutorial on getting and compiling PanoSalado's source code:

First to get it:

Google "SVN client" and pick a SVN client you like, there are a wide variety available, from the basic command line binaries to GUI apps. (On OS X, I like svnX, and if someones got a rec for Win and *Nix, I'll update this).

Then connect to the PanoSalado SVN repository at http://code.google.com/p/panosalado/source/checkout and checkout a copy of the code in the src folder, which includes all of PanoSalado and the supporting libraries.

On to Compiling PanoSalado:

You can compile it with the FREE Flex SDK downloadable at:
http://www.adobe.com/products/flex/flexdownloads/

Or if you have FlexBuilder 3 or later, or Flash CS3 or later, and feel more comfortable with them, you could compile in them. In FB, you just create a new project with the source folder, and in Flash, you create a new Flash File (AS3) and set e.g. PanoSalado.as to be your Document Class in Publish Settings -> Flash -> Settings.

But I am going to focus on the the free and open source Flex SDK. Once it is download, in OS X you get onto the command line, and type in e.g.:

path/to/just/downloaded/flex_3_sdk/bin/mxmlc  path/to/src/PanoSalado.as

So you are executing the program called mxmlc (mxml compiler) and giving it the path to PanoSalado.as (notice that space separating the two). And if you are on a *Nix, the command should look almost identical, if not identical. And if you are on Windows, you would use mxmlc.exe, instead of mxmlc, and change the path syntax to windows path syntax. Finally, if you put mxmlc in the list of executables in your shell environment, and cd into the source directory, you can just type this:

mxmlc PanoSalado.as

Please ask any questions you might have about all this. We don't mean to mystify anyone, it just happens. And I hope this helps some people get into Actionscripting and plumbing PanoSalado better.

Zephyr Renner

re: Getting and Compiling PanoSalado Source

Good one Z!

I just wanted to add that Flex Builder will also connect directly to the code repository. Get the Google-generated info at http://code.google.com/p/panosalado/source/checkout, then head on over to this excellent walkthrough for adding "Subclipse" to your Flex install. Once Flex is happy with Subclipse, you're golden. Smile

Flex+Subclipse:
http://www.nodans.com/index.cfm/2007/10/8/Adding-Subclipse-to-Flex-Build...

I didn't need to do the Java update, so just follow the second half of the instructions, first.

Once Subclipse is installed and Flex is restarted, choose (on Mac) File::New::Other. Then go down the rosy path for SVN.

I did the steps for "creating as if a new project" from the new project wizard. A tad unintuitive, but got it done.

Cheers,

Patrick

Thank you for

Thank you for instructions.

But I have following exception when start compiled SWF (compilation goes without any errors or warnings. mxmlc version 3.0.3 build 2490)

"
ReferenceError: Error #1065: Variable ModuleLoader is not defined.
at flash.system::ApplicationDomain/getDefinition()
at PanoSalado/stageReady()
"

Any advice?

Error about ModuleLoader

Hi,

If you are seeing that error you are not loading PanoSalado with ModuleLoader.swf. (You are probably loading it by itself). Embed ModuleLoader.swf in your html, point it at your XML file, and in the XML file, one of your layers should point at PanoSalado.swf

Zephyr

re: error about moduleloader

I've added a forum post which shows the basic HTML embedding methods for PanoSalado. Enjoy it at:
http://flashpanos.com/forum/basic-html-embedding-panosalado

Cheers,

Patrick

Coda now supports Subversion/source control

I just wanted to add Coda to the list of applications that will let you view/checkout the source repository. This update to Coda makes yet another fine addition to Panic's stable. Mac only.

http://www.panic.com/coda/

Cheers,

Patrick

FLA files

Hi guys, just wanted to first say that I love what you've done here and am excited about the possibilities! I've downloaded the free Flex SDK and built the rev 128 project, but I have a question: if I wanted to change the navigation bar from the green color to a red color, how would I do that? I'm guessing that the bar is in the UserInterface.fla file, and I haven't figured out how to open those files. Is there a free utility I can use or do I have to own a copy of Flash? Am I right that some aspects of the tool are in those FLA files?

Thanks!

re: FLA files

Hey there:

Thanks and Cool!

The "stock" UserInterface.fla which comes with the downloads is a FLA, which you'll need to open in Flash since it embeds the button images inside of it.

That said, you can use the UserInterface.as file, and create/embed your own images via Flex. There should also be a Flex example interface which comes with the downloads.

HTH!

Patrick

Flex User Interface comes up blank

After downloading the source from svn, I'm trying to compile PanoSalado, but the resulting .swf always ends up blank. I've tried from the command line using "mxmlc PanoSalado.as", as well as trying to compile FlexUserInterface.mxml from within Flex Builder. All I get is a black-to-grey gradient background in the resulting swf.

Thanks,
Marty

Re: Grey screen

It sounds to me like you haven't compiled ModuleLoader.swf. You don't directly load PanoSalado.swf or an interface swf. You embed (or load) ModuleLoader.swf and ModuleLoader.swf load the settings XML file (by default it looks for PanoSalado.xml beside it), and in the XML file you tell ModuleLoader what to load, i.e. PanoSalado.swf, an interface swf and any other swf's you want.

Hope that helps.

Zephyr

Compile error with revision #129

Hi,

New user here. I come from a background in programming, C++ and Java, but am fairly new to Flash and ActionScript.

I've downloaded the latest sources from the Subversion repository, and downloaded the Flex SDK. I try to compile the .as files, but when running
mxmlc.exe UserInterface.as
I get the following errors:

Loading configuration file C:\Program\Flex_sdk\frameworks\flex-config.xml
E:\Dokument\Flash\PanoSalado\panosalado-read-only\src\UserInterface.as(32): col:
 25 Error: Type was not found or was not a compile-time constant: Bg.

        private var buttons_bg:Bg;
                               ^

E:\Dokument\Flash\PanoSalado\panosalado-read-only\src\UserInterface.as(33): col:
 32 Error: Type was not found or was not a compile-time constant: Container.

        private var buttons_container:Container;
                                      ^

E:\Dokument\Flash\PanoSalado\panosalado-read-only\src\UserInterface.as(41): col:
 28 Error: Call to a possibly undefined method Container.

                        buttons_container = new Container();
                                                ^

E:\Dokument\Flash\PanoSalado\panosalado-read-only\src\UserInterface.as(42): col:
 21 Error: Call to a possibly undefined method Bg.

                        buttons_bg = new Bg()
                                         ^

Any ideas what could be wrong? Compiling the other files does not give any errors, but if I try replacing e.g. the PanoSalado.swf in the example with the one I've compiled myself nothing works, I only get a blank window. (Filesizes also differ, the original is 137 kB while my compiled version is only 88 kB.) I'm on a PC, I guess the example files have been compiled on a Mac?

I'm also curious if there is a specific build order that should be followed, or are all swf:s independant of each other?

Kind regards,
Lizzan

Compiling OK...

...just found the thread http://flashpanos.com/forum/panosalado-absolute-n00bs and managed to get the UserInterface.fla to compile, and using it worked. I still have a problem with the PanoSalado.as not working if I use my own compiled file, though.

Of course...

...as soon as I had posted my last comment, I tried compiling the PanoSalado.fla (from Flash CS3) instead of the .as, and it worked perfectly. Hope this can help someone else with problems, at least...=)

/Lizzan

re: compiling PanoSalado via Flex vs Flash CS3

Hey Lizzan:

Glad to hear you've got it sorted out. Thanks also for the line by line info as to your experience.

Zephyr uses Flex/mxmlc to compile out Panosalado, so I'm surprised you had issues there. I'll need to poke around a bit and see what's going on (or not going on). I use Flash to compile things, so we have both ways covered.

I imagine we'll have a new source download some time soon -- Both Zephyr and myself have been on other gigs recently and haven't had as much time for the open source project as we'd like.

Keep us posted!

Cheers,

Patrick

Once it compiled...

...I really like your software! And the source is very well written (from a modder's point of view). I've already, after only 5 hours work (remember, Flash noob here), been able to do what I set out to do. What I wanted was to have an external flash showing an approximation of the current visual field. I've currently got the pan covered, with this much time left I might even manage to get the zoom and tilt in there as well (if I can just figure out the maths...).

Thanks for a great product! It will surely be used in many of our coming projects. (This is us, by the way: http://www.tikab.se/index.html?language=en ) Looking forward to the new source!

Regards,
Lizzan

re: modding PanoSalado

Hey Lizzan:

Good to hear, you're welcome, and thanks! Smile

Keep us posted on your projects -- if you ever have anything we can link to as an example, let us know. Likewise, if you make any mods or additions which you think might be good to put in the core code, let us know.

Have fun!

Cheers,

Patrick

Textual Tooltips and External Interface

Hi again,
Next hurdle I need to get over is getting textual tooltips to work. I've read somewhere here that it's on your ToDo-list - do you think it will be done soonish rather than later? If later, I don't mind doing some work myself, but I'm at a loss for how to get the appropriate notifications.

From http://flashpanos.com/forum/basic-xml-structure-panosalado-rev-73 , comment 2 and the changelog http://code.google.com/p/panosalado/source/browse/trunk/src/History.txt revision 58 it seems I need to listen for a BroadcastEvent.SHOW_TOOLTIP in UserInterface or another swf. I've added

private function layersReady(e:Event):void {
    ...
    this.addEventListener(BroadcastEvent.SHOW_TOOLTIP, showTooltip);
    ...
}

private function showTooltip(e:*):void {
    trace("Showing tooltip");
    trace(e.toString());
}

to the UserInterface.as file, and have a hotspot as below in my PanoSalado.xml:

<hotspot id="toConcert2"
         useHandCursor="true"
         pan="-20"
         tilt="-10"
         segments="2"
         oneSide="false"
         smooth="true"
         onClick="loadSpace:preview2"
         tooltip="To Concert 2"
         >

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

but I never get any of the traces. I've probably written something wrong but have no clue as to what. Anything else that needs to be done?

I'll also be needing to be able swap spaces by clicking links on an html page, and I've read about using External Interface for this. Do I need to modify PanoSalado.as to include the code and functions in http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external... or do I make the changes somewhere else?

(Still having fun...sort of... At Wits End Wink )

Kind regards,
Lizzan

re: tooltips

Hi:

I second your statement about still having fun, sort of.... grrrrr programming.

Anyway: tooltips: in a user interface swf get a reference to the the parent, ModuleLoader. This is already written. Then use the reference to ModuleLoader to put a listener on it for BroadcastEvent.SHOW_TOOLTIP and BroadcastEvent.HIDE_TOOLTIP. e.g.:

moduleLoader.addEventListener(BroadcastEvent.SHOW_TOOLTIP, handler, false, 0, true);

private function handler(e:BroadcastEvent):void
{
     for each (var s:String in e.info)
     {
            trace(str, e.info[str]);
     }
}

That will trace out all the info you need to display the tooltip.  

Assuming of course that you set the tooltip in the XML on whatever hotspot or other 3D.

Hope that helps.

Zephyr

A bit closer, but...

...I still don't get any traces. Have added the function

private function handler(e:zephyr.BroadcastEvent):void
{
         trace("Yohooo!");
         for each (var str:String in e.info)
         {
                trace(str, e.info[str]);
         }
}

and the line

moduleLoader.addEventListener(BroadcastEvent.SHOW_TOOLTIP, handler, false, 0, true);

in the end of the layersReady function. Hotspot code as above. Any ideas?

BTW, my earlier question about External Interface has been solved, I added the relevant parts of the example at the link I mentioned in the PanoSalado.as and it works beautifully.

/Lizzan

Got it now...=)

Tiny error in the XML file, had written tooltip (small t) instead of toolTip with a capital second T. Now I get the traces - all that remains is to do something with 'em...=)

Thanks for your help Zephyr!

/Lizzan

Tooltips working!

Just an update...I've got the tooltips working now, so all is well. Thanks again for a great framework to work in, it's been a blast and I'm sure I'll get to work more with it in the future. I don't mind sharing my tooltip code if you want it, but it's very basic in comparison to the rest of your work and not very customizable from outside. Just let me know and I can send it by e-mail.

Regards,
Lizzan

Works works with Flash IDE but not with mxmlc

Lizzan wrote:

Any ideas what could be wrong? Compiling the other files does not give any errors, but if I try replacing e.g. the PanoSalado.swf in the example with the one I've compiled myself nothing works, I only get a blank window. (Filesizes also differ, the original is 137 kB while my compiled version is only 88 kB.) I'm on a PC, I guess the example files have been compiled on a Mac?

I'm also curious if there is a specific build order that should be followed, or are all swf:s independant of each other?

I'm running into the same problem as Lizzan. PanoSalado.as compiles fine both in Flash IDE and with MXMLC but file sizes differ and only the Flash-compiled swf works.

Any suggestions?

Thanks,

E

re: Works with Flash IDE but not with mxmlc

snawbel/Lizzan,

I was having the same problem when developing updates for PanoSalado on XP. I compiled with the following command line :
mxmlc -use-network=false PanoSalado.as
My PanoSalado example worked just fine. The swf file size also went from 137kb to 88kb, but this can be attributed to the fact that the -compiler.debug option was not used.

Good Luck!
Gandalf