在krpano中参数传递需要注意的几个地方,我们以下面案例说明。
	
	
		<action name="actiondemo"> 
	
	
		parameter(1,2); 
	
	
		</action> 
	
		<action name="parameter" args="p1,p2,p3" scope="local"> <!--p1,p2表示需要传递的两个参数,scope="local"必需加,否则无法获得值--> 
	
	
		addhotspot(get(selectBtn));<!--动态增加一个热点对象--> 
	
	
		set(hotspot[get(selectBtn)],type=text,ath=25.535 html=get(p1),bid=get(p2));  
	
	
		linkeventscope(hotspot[get(selectBtn)]);<!--要想在下面onclick中获得参数,必需加上这句,否则无法获得参数--> 
	
	
		set(hotspot[get(selectBtn)].onclick, 
	
	
		set(object,get(p3)) ); 
	
	
		</action> 
	
	
	
以上就是action传递参数的参考案例。希望对大家有帮助。


 
 
 QQ扫码添加好友
QQ扫码添加好友