HomefieldOfView | SPi-V dev

Navigation

user

Make HTML parameters accessible in SPi-V

I set a variable in the global section of an "image" xml. It is a href to a page that I want opened in a "default" menu xml menu.

How do I use the variable? I can't seem to get the value? Alternately, all I need this the href of the current document. Ideally with params, but I can make do without I just need the current page href... by hook or crook... I don't care.

Also, are you willing to pass along params from the object tag as global read only variables?

<object required-stuff="required values">
<param name="a-bunch-of-required-stuff" value="a bunch of required values"/>
<param name="something-the-developer-needs" value="whatever"/>
</object>

This is a test of what I'm attempting...
http://www.dlgreene.com/asp_testing/vr_spi_v.aspx?panid=2006-10-08_15-00...

It's a copy and paste of your toolbar with a (poorly drawn)button added. For maximizing the vr in the window. I really need parameters in order to put it into production.

Admin note: moved this topic from a discussion on the variable node docs.

Re: <variable>

You should be able to use getProperty() on variables.

Shockwave has no access to the containing HTML element(s), and only to limited parameters in the object/embed tags. I will see if I can come up with a creative way to access these parameters from within SPi-V.

Re: <variable>

Thanks-

I did try getProperty() but it didn't seem to work in the toolbar.xml. I set the variable in the image.xml.

Anyway, if you follow the code link on page:
http://www.dlgreene.com/asp_testing/vr_spi_v.aspx?panid=2006-10-08_15-00...

or just use this link:
http://www.dlgreene.com/asp_testing/vr_spi_v.aspx?displaycode=true

and scroll to the bottom of the page I stuck the SPi-V xml files in so that you can see the actual xml files that are being used.

I assume you must be either reading or had another programmer read in the xml so that you can use the data. If you are using a procedural language to get the dataset you need, I STRONLY suggest that you handle that part of the operation in XSLT so that you get in the procedural language a "fixed" dataset as a result. I'm assuming alot here but, PureTools does a very similar thing. XML and XSLT is VERY powerful for what it does and if you are trying to do that part in java/action script or whatever procedural language you are missing all the power, not to mention the hairpulling headaches.

Further, an XSLT stratagy could fairly easily be passed on to the end developer without all the headaches. All you care about is a nice "fixed" resulting dataset that you can use in whatever. And you are not linked into any procedural language... Most don't realize it but, if I take out the view code part of my web site I could be up and running under a PHP server in about an hour.;) Obviously there may be some theory involved in that statement. But, I don't believe it to be inaccurate.

Re: <variable>

> I assume you must be either reading or had another programmer read in the xml

One more time: I am NOT reading your XHTML; I could not if I wanted to! SPi-V gets a reference to the SPi-V XML file you specify in swURL. That SPi-V XML file is already in the schema that SPi-V needs, so there is no need to use XSLT.

Re: <variable>

Sorry for the mis-understanding...

I never thought you were reading the xhtml I assumed you understood that I was refering to the xml that is in the "image" xml file.

Re: <variable>

Alternate to passing along parameters...

If there was a swURL_xml parameter that could take the actual xml, it would work fine also. The initial "image" xml is small and is unlikely to put much of a burden on the browser. Clearly the "image" xml may open up other xml's but, that's no differant than now.

In fact that would be the prefered method for me as it's clearly no problem to generate the exact xml I need in a small predictable dataset. I think it might be easier for you as well. I'm not sure but, a reasonable assumption would be that whatever has to open the file then "reads" the xml. Instead just "read" the xml.

The only problem that I think can be very easily solved it that the input would have to be <![CDATA[xml data]]>ed.

Re: <variable>

> If there was a swURL_xml parameter that could take the actual xml

That's not going to work. I am pretty certain there is a limit to how much CDATA one can push through a param's value. Also, like I said I can not use arbitrary param names (here's a list). These are Shockwave limitations.

You can have your SPi-V xml file created dynamically, which would solve all the problems I understand you are having.

Re: <variable>

There is no limit on CDATA from a techical stand point. There may be limits on currently available resources. However that discussion is irrelevant to this discussion as the amount of resource use in this instance is TINY.

Thanks for the link to the page on params... Could you read it for me! As far as I can tell it tells you precisely what I suspected... You can easily pass on the parameters. In fact it would be an almost identical process to the one I used here:
http://www.dlgreene.com/code_info.aspx?displaycode=true&code-file=aaa_ma...

The first function... All it does is read any parameters that were passed to the page and pass them along as XSLT parameters. I don't care what thier names are or what their values are I just pass them along.

In your case it's slightly differant in the proccessing order but, I don't think it's unreasonable to assume it's an extremly similar process...
Do a for each loop on the parameters put on the object...
Make the values and variables available to the current process.

Terribly sorry for the confusion.

Re: <variable>

I am not saying CDATA is limited. I am trying to say that in many issues like this I am limited by Shockwave. Shockwave will probably not let me pass significant amounts of information in a param (and the equivalent embed).

I am not going to implement a functionality that is so limited that it will work for you but not for many others; I will be looking at a more generic solution.

However, there's no need to wait for me. You can extend the functionality of SPi-V yourself. This is how I made the extensions on the downloads page.

Re: <variable>

Sorry-

I meant any parameter...

I'm reasonably sure others might like to be able to pass parameters as well. I suppose it's possible that you have never been asked if the SPi-V toolbar could be easily set up to do Page Prev or Page Next? I assume there are a mountain of other things that parameters could be used for that I can't even think of.

Again... I apologize if I have offended you in any way.

Unfortunatly, I try to work with the Adobe stuff and I have written some very minimal ActionScript but I dread it and can't figure out what or why Adobe refers to things in such weird terms. Do I need a sprite or a stage or what? The terminogy is so foriegn to me I just don't get it.

The terminology terms are probably the main reason we seem to be clashing. I think I'm saying one thing and you read me saying something completely different.

Again... I apologize if I have offended you in any way.

An alternative answer

This should work but it doesn't... (swURL is the point of interest)

<object id="dlg_vr_spi_v" style="width: 640px; height: 480px;" data="SPi-V.dcr" type="application/x-director">
<param name="pluginspage" value="http://www.macromedia.com/shockwave/download/" />
<param name="src" value="SPi-V.dcr" />
<param name="swURL" value="vr_spi_v_image.aspx?panid=2007-07-01_05-55-51" />
<param name="swStretchStyle" value="stage" />
<param name="logo" value="false" />
<param name="bgcolor" value="#000000" />
<a href="http://www.adobe.com/shockwave/download/" title="Get Adobe Shockwave Player" class="btn-get-shockwave-player">
<img alt="Get Adobe Shockwave Player" class="btn-get-shockwave-player" title="Get Adobe Shockwave Player" src="images/btn_get_shockwave_player.jpg" /></a>
</object>

As an example that it should work please view:
http://www.dlgreene.com/vr_puretools_image.aspx?panid=2007-07-01_05-55-5...
is being used by:
http://www.dlgreene.com/vr_puretools.aspx?panid=2007-07-01_05-55-51

I realize that I'm not particularly welcome here, but this should work. It has nothing to do with Puretools that Puretools works like this. Further PLEASE belive me that I have no fondness for Puretools... I only site it as an example. I am, after all, here asking for this to work. It's about telling my server to return xml data for this particular page and not xhtml data. This same thing could be done for images as well. For images I would tell the page to return jpg data instead of xhtml.

You appear to be saying that you are just letting Adobe take care of this parameter... So I assume this just won't work because of Adobe and not you?

I further wish to apologize about the xslt confusion... I have, in the past, browsed the Adobe technical articles and I saw quite a bit of xml and I assumed that there would be no way that there would be so much xml without the other two "pillars" schema and xslt. I'm terribly sorry for making such an assumption.

Just for your information xml as you are forced to use it, is pretty useless. In the form that Adobe has given it to you it's nothing more than a text file delimited in an xml format. Without schema AND xslt it's "brain dead" and must be pretty frustrating. It does give you a way to do what you are doing but you really need to belive me when I tell you that just a text file delimited to appear as xml is nothing great that Adobe has given you.

Again I can't apologize or sympathize enough.

Re: An alternative answer

> I realize that I'm not particularly welcome here

That's not true. Really, it isn't.

The way you are talking you seem to have all the answers, but in fact the solutions you come up with ('can't you just...') don't have much bearing for SPi-V. We seem to be talking in two different languages. I think you may have a strong background in java programming, am I right? I don't have much experience at all with java.

Case in point XSLT. There is no such thing as XSLT in Shockwave. If I wanted to do XSLT in Shockwave, I would have to write my own XSLT processor in Lingo (Shockwave's scripting language), which would make SPi-V at least twice as large as it is now, and I still don't see the benefit of having XSLT inside SPi-V.

If you are talking about using XSLT to generate the XML that SPi-V is pointed to, you are free to do so. That should work as is, because SPi-V does not care one bit how the file is created. That is afterall the charm of XML.

Re: An alternative answer

"The way you are talking you seem to have all the answers"
Believe me I don't, sorry if I come across that way. I'm only a hacker at best.

"Case in point XSLT. There is no such thing as XSLT in Shockwave"
That's what I was trying to apologize about... I had no idea that Adobe didn't give you xslt until we starting "talking". I assumed that there couldn't possibly be so much xml without xslt or xsd(schema). And you are 100% correct that it would be crazy to try and write a xslt "compiler" just for yourself. This is one of the main things that baffles me about Puretools, they have VERY powerful xml, xslt, xsd tool at their disposal in Java but instead decided to become psuedo javascript compiler writers. No matter how much I might think it's a "brave" effort... the "script" they have is at best "quirky". With a few lines of code and faithfully passing in parameters to xslt they could have an entire (fully debugged) programming environment with exponentially more power.

I should be able to get a "demo" up of what I'm trying to do by tomorrow. It's not complicated... I just want to have a single source for the xml file. I'm using a aspx file to "serve" it. Adobe is somehow "analyzing" the file name and failing to open... You'll see what I mean... I have double checked and "copy and pasted" the results of the aspx and made a static file to be sure that I am, in fact, returning a valid file.

The obvious advantage to this is clearly the "organization factor" and that I can build menus for the particular vr "on the fly" or more accurately based on the "data" that I have stored for the particular panorama.

I don't think you will be able to do anything about the error, I'm pretty sure it's Adobe and not you. However you are clearly more adept at Adobe and might be able to figure out a way to make it work. It's possible a simple "syntax" change in the parameter might "trick" it to work.

Also, please be aware that while my current web "framework" is being served by MS a PHP server has the same possiblilities... i.e. PHP pages can also be told what mime type to serve.

I'm mostly a xml, xslt, xsd, xhtml programmer... Though I have a fair knowledge of C#. Other languages I "dabble" in are c++, lisp, visual basic, java, javascript. I'm thinking about Ruby (for the RAILS framework, though I hate Ruby's syntax even though that's what most people like)

Re: An alternative answer

Here's another 'nice' one for you; Shockwave does not 'listen to' mime-types being served up, so I have to rely on file extension sniffing in some cases.

I think the problem you are currently facing is that the generated xml you point towards is not being recognised as XML. Is that correct? If that is the problem, would it be at all possible for you to serve up the XML file with one of the following extensions?
xml, spv, txt, asp, php

Re: An alternative answer

"xml, spv, txt, asp, php"... Extensions.

Unfortunatly, the parameters are the "key" to making the whole thing work.

i.e. filename?param=xxx&param2=whatever

Re: An alternative answer

"Extension sniffing... fails"

Yea, I believe you are right... Here's a "demo"...(link I stuck in is the swURL param)
http://www.dlgreene.com/asp_testing/vr_spi_v.aspx?panid=2007-07-01_05-55...

I hope you can see how if this did work it would be a very powerful tool. You may have to resort to "specific" parameters but, for me and for anyone as a web developer it opens up alot of possiblities. What I have currently done with the current menu is obviously pretty lame and is litteraly just a demo.

Further don't assume this stragegy is in anyway dependent on xslt to work. It's about what the developer tells the server what mime type to serve to the client and that is just as easy with MS as it is for PHP. It's pretty easy to serve xml from a database, for instance.

As you say, Adobe screwed you... AGAIN! You must think I'm out of my mind with the xslt stuff but if you ever have the chance to talk to a xslt developer and you let him/her read what I'm trying to explain. The experience maybe somewhat depressing for you and "if it were a dog, it would have bit you". It's VERY much a "bone head" stratagy IF Adobe gave you the tools.

Re: An alternative answer

I would not say Adobe screwed me. Or Macromedia, because we're currently still using Macromedia code ;-).

Any time you work with someone else's framework, you have to accept there are going to be limitations. Some limitations can be worked around, some can't. My current stance is that even though Shockwave is starting to show more and more limitations, there's an awful lot it can do, especially considering it's using a 5 year old 3d engine in an 11 year old multimedia framework.

Re: An alternative answer

I hear you but, that's the beauty of xslt used along with xml. Adobe has "overlaid" new versions of actionscript "over" the "top" of many things at this point. Noteabley what they are selling as the ability to work with xml formatted files.

What is hard for you to "see"(not your fault) is the definition of xslt. It's a "translator" of one format to another. It seems to me (again I have only glanced the Adobe techical doc) that Adobe is making a push to a more "xml" environment in what appears to me this Flex thing. It looks like a xml format to me.

You need a xml data format for your application. You then "translate it" to the xml format that Adobe uses... It's a straight up xslt operation... Nothing complicated... Nothing fancy... End user translated to your format then your format translated to Adobe's format. The fact that Adobe has not made you and every other Adobe developer aware of this and given at least rudimentary tools in that area appears to me as an xslt programmer an unadulterated "ripp off". I agree that Adobe has a place in the graphics arena but as you say a large portion of those "internal algorithms" have been functioning for a number of years... I see Adobe as setting you Adobe programmers up for another sale. Now that you have all this xml stuff set up would you like us to sell you something we should have given you in the first place?

Re: An alternative answer

The query string should not be a problem, SPi-V just needs the extension to be either one of the ones I listed.

ie: filename.asp?param=xxx&param2=whatever
instead of: filename.aspx?param=xxx&param2=whatever

Perhaps you can do something similar to using mod_rewrite (which would work for Apache, but there are similar tools for IIS)?

Re: An alternative answer

One place that I didn't consider in my current rudimentary web framework... I may be switching to a PHP server in the future so I will revisit then.

Anyway, Thanks very much for your patience and time.

Re: An alternative answer

Just to be sure...

You are aware that *.aspx is the standard for MS .net server files and has been for any "from scratch" server app for about 3-4 years?

the following is not a direct look up but the extension should be self documenting:
http://msdn2.microsoft.com/en-us/default.aspx

Re: An alternative answer

I had not realized there was a real difference between .asp and .aspx (I thought it was more along the lines of .htm and .html). SPi-V 1.4.6 will correctly recognize the .aspx extension as a possible xml file.

Re: An alternative answer

Reasonable assumtion.

Anyway thanks!

Also I have laid out the page a little different and noticed an oddity that is not an error but you may find it interesting as it may explain something only you would know about.
http://www.dlgreene.com/asp_testing/vr_spi_v.aspx?panid=2007-07-01_05-55...

In IE 7.latest only half the "no image" image shows. I have verified a static xml file and the vr shows correctly. Also, because of the way I generate the xhtml across the different viewers there is no(at least it's extremely unlikely) difference in the xhtml surrounding the object tag and the other viewers appear correct. The height is off for SPi-V only because I have the link to the dynamic xml that is in the swURL param tag underneath the object tag.

Again thanks and this oddity doesn't matter to me, I just thought it might interest you.

Re: An alternative answer

You mean the red diagonal cross on a white background? This is by design.
Feel free to create a new thread for new subjects like this.

Re: An alternative answer

Thank you sir!

It works!

http://www.dlgreene.com/

Re: An alternative answer

> This should work but it doesn't... (swURL is the point of interest)

Could you tell me in clearer terms what does not work here?

What exactly are you trying to accomplish in this example?
What steps are you undertaking to accomplish it?
What happens?
What were you expecting to happen?

Please answer all questions, in one place, and mind our apparent language barrier. Try not to talk in solutions (because our solutions have a 'history' not to work for eachother), so we can get a clear grasp at the problem.