Sie sind nicht angemeldet.

1

Montag, 14. Juni 2010, 14:57

AS3: get path placeholders inside of a plugin in flash

Hey!
I'm new here and new to using KRPano.
Maybe the question I'm going to ask is stupid, or I just overlooked something obvious, anyway thanks for all the help and patience in advance!

I'm atm developing a plugin, and I'd need to load external images inside of it. It's all good using relative or absolute paths, but I'd like to use the krpano placeholders like %SWFPATH%, %CURRENTXML%, %BASEPATH% to simplify configuration. So is it possible to somehow get the value of these inside of the plugin, and if yes, how am I supposed to make that happen?

Thanks :)

2

Freitag, 20. August 2010, 16:52

Doesn't seem at all stupid. I have the same desire but I certainly can't find any helpful documentation to indicate how to get the expansions of placeholders. Anyone found a way to do this?

3

Freitag, 20. August 2010, 17:24

FWIW despite Klaus' claim in AF Components Scrolling panel doesn't work inside Krpano that the url property of a subnode is available with placeholders expanded I have not seen this to be the case.

Quellcode

1
2
3
<plugin name="aswfpath">
  <aswfpath url="%SWFPATH%"/>
</plugin>


accessed by

Quellcode

1
krpano.get("plugin[aswfpath].asfwpath.url");

still arrives as "%SWFPATH%" rather than its expansion.

Even if the above worked as advertised it doesn't cope with the situation I have where I want to have multiple subnodes with the same tag ie,

Quellcode

1
2
3
4
5
<plugin name="slideshow" url="%SWFPATH%/plugins/slideshow.swf">
  <slide url="%SWFPATH%/slides/foo.jpg"/>
  <slide url="%SWFPATH%/slides/bar.jpg"/>
  <slide url="%SWFPATH%/slides/baz.jpg"/>
</plugin>
as one can only access the url of the last slide node.

4

Montag, 23. August 2010, 11:08

Hi,

here is an internal function called 'parsepath' for path resolving,

e.g.

Quellcode

1
2
3
var parsepath:Function = krpano.get("parsepath");

path = parsepath(path);


but I would recommend using the loadfile / loadobject interfaces for such files,
see here:
cant embed plugin..

these can be also used to load embedded files,

best regards,
Klaus