You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

1

Tuesday, February 10th 2009, 9:53am

URL encoding?

Hi,

I have made a plugin that reads an external xml and uses its data to show info, loads a still image etc. I came across this problem, and can't figure it out if its a URL encoding error, security issue or something else.

This works:

Source code

1
2
3
4
5
6
<plugin 
url="plugins/still.swf?req=somexml.xml"
zorder="97" 
align="center" x="0" y="0" 
children="true" visible="false" cursor="false" handcursor="false" 
/>


This doesn't (check the url, not a real adress btw)

Source code

1
2
3
4
5
6
<plugin 
url="plugins/still.swf?req=http://somewebsite.com/somexml.xml"
zorder="97" 
align="center" x="0" y="0" 
children="true" visible="false" cursor="false" handcursor="false" 
/>


This doesn't work either (it loads only the req and not var2, and if I turn them around, it loads var2 and not req)

Source code

1
2
3
4
5
6
<plugin 
 url="plugins/still.swf?req=somexml.xml&var2=someothervariable"
 zorder="97" 
 align="center" x="0" y="0" 
 children="true" visible="false" cursor="false" handcursor="false" 
 />


Flash tracer plugin doesn't give me any sandbox security errors or any other errors, krpano debugger says it can't find the file.
Anyone got any clue?

Btw I use this function in Flash, but Im almost 100% certain it's right and that the problem lies in the xml

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function startplugin(event:Event):void
{
krpano = krpano_as3_interface.getInstance();
if (loaderInfo.parameters.req==null) 
{
apireq = "blanco.xml";
} 
else
{
apireq = loaderInfo.parameters.req
}
/* if (loaderInfo.parameters.var2==null) 
{
apireq2 = "blanco.xml";
} 
else
{
apireq2 = loaderInfo.parameters.var2
}*/
RequestXML(apireq);
}


and crossdomain.xml, allowing all domains:

Source code

1
2
3
4
5
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
</cross-domain-policy>
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

2

Wednesday, February 11th 2009, 12:16am

Hi,

I have tested this now,
for me passing parameters (also urls) is working (online and offline)...


did you use the Flex SDK (mxmlc) or Flash CS3 to build the plugin?
try to trace ALL parameters, maybe this helps to find the problem...

e.g - AS3:

Source code

1
2
3
4
5
6
7
8
krpano.trace(0xFF,"enable debug mode");
krpano.trace(0,"loaderInfo.parameters:");
			
var params:Object = loaderInfo.parameters;
for (var varname:String in params)
{
  krpano.trace(0,varname + "=" + params[varname]);
}


best regards,
Klaus

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

3

Wednesday, February 11th 2009, 10:38am

I've pasted the piece of code, and swithed the krpano.trace with a normal trace(for some reason krpano.trace never worked). But it doesn't trace anything (using flash tracer addon). So I thought maybe it gets stucks along the way so I put 2 traces before and after the parameter trace. Like this:

Source code

1
2
3
4
5
6
7
8
	trace("begin trace")
	var params:Object = loaderInfo.parameters;
	for (var varname:String in params)
	{  
	  trace(varname + "=" + params[varname])
	  //krpano.trace(0,varname + "=" + params[varname]);
	}
	trace("end trace")


If I link to: url="plugins/still.swf?req=http://www.darkgfx.com/ObjectDetails2.xml"
The trace output is completely empty (not even begin trace/end trace) and the still swf wont be loaded (not even interface stuff, is completely blanc)

If I link it to url="plugins/still.swf?req=ObjectDetails2.xml", it loads the still and

I get

Quoted


begin trace
req=ObjectDetails2.xml
end trace
I have no clue what so ever... It seems it's looking for a file called "still.swf?req=http://www.darkgfx.com/ObjectDetails2.xml" instead of still.swf with the req as parameter. Because the error krpano gives, is the same error you get when it cant find a picture.

Edit: When I remove http:// from the req it works! url="still.swf?req=www.darkgfx.com/ObjectDetails2.xml"
So I thought, ok it seems to deal with the / correctly, maybe it's the : I Url encode the all the slashes and : to

Source code

1
http%3A%2F%2F
and it works. Probally the : doesn't get encoded right?
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

4

Wednesday, February 11th 2009, 9:16pm

Hi,

which browser and flashplayer version are you using?
I tested also passing a variable with "http://..." successfully

krpano.trace(0, ... ); traces to the krpano log,
but the first parameter means it is a debug message
(see also in krpano_as3_interface.as)

you could also write:
krpano.trace(krpano_as3_interface.DEBUG, ... );

but DEBUG messages are only shown, when the DEBUGMODE is enabled,
either via <krpano ... debugmode="true"> in the XML
or via - krpano.trace(0xFF,"enable debug mode"); in AS3

do you have this example online?
it would be interesting to test it, I have no idea why it shouldn't work...

best regards,
Klaus

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

5

Wednesday, February 25th 2009, 2:57pm

Sorry for the late reply,

The debugmode works now. It seems that I copied an older version of krpano_as3_interface.as

For those reading the topic. Make sure you get krpano_as3_interface.as from http://krpano.com/docu/plugins/

and NOT the one in the zip of Flash CS3 plugin example @ http://krpano.com/examples/interface/
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

6

Wednesday, February 25th 2009, 10:10pm

hi, yes you're right, sorry the Flash CS3 example is very old and outdated,
the example was build with the Flash CS3 30day trail version

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

7

Monday, March 2nd 2009, 12:51pm

What's the type of the first argument in krpano.trace(0xFF,"enable debug mode");
The 2nd is a string, but im not sure of the first, seems a string to. It's for the dummy function Im trying to make so I don't get value is not a function error messages in flash ;p
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

This post has been edited 1 times, last edit by "Zephyr" (Mar 2nd 2009, 4:54pm)


8

Tuesday, March 3rd 2009, 12:10am

Hi, the first parameter is a "Number", the second can be any string on this call