我想传值到SWF里,JS中的变量sessionid的值怎么传不进去呢?还望高人指点一下,真心感谢,鞠躬了
我想传值到SWF里,JS中的变量sessionid的值怎么传不进去呢?还望高人指点一下,真心感谢,鞠躬了
这段是AS代码
import flash.net.FileReference;
import flash.external.ExternalInterface;
stop();
var sessionid:String ='11';
ExternalInterface.call("getsid()");
var uploadProgressScript:String = '感谢使用系统'+sessionid;
=========================================
这段是JS代码
function getsid()
{
var id2 = <?php echo session_id()?>";
document.jqUploader.SetVariable("sessionid", id2);
}
==========================================
这是页面插入FLASH的代码(是不是这里写少了)
<EMBED src="jqUploader.swf" width=360 height=160 type=application/x-shockwave-flash wmode="transparent" quality="high">
===========================================
另外:FLASH里面分5层 每层只有一帧,上面这段AS代码写在第一层(名叫action的层)中的第一帧了,跟这个有关系吗?
------解决方案--------------------
我这样调用flash并传递sessionid是可以正常接收的.
你可以参考swfupload这个组件看看他的as代码的写法
下载地址是:http://code.google.com/p/swfupload/
<object width="113" height="26" class="swfupload" data="/@img/@swfup.swf?preventswfcaching=1348974809689" type="application/x-shockwave-flash" id="SWFUpload_0"><param value="transparent" name="wmode"><param value="/@img/@swfup.swf?preventswfcaching=1348974809689" name="movie"><param value="high" name="quality"><param value="false" name="menu"><param value="always" name="allowScriptAccess"><param value="movieName=SWFUpload_0&uploadURL=%2Findex.php&useQueryString=false&requeueOnError=false&httpSuccess=&assumeSuccessTimeout=0&params=action%3Dupatpub%26amp%3Bsessionid%3D44g0h79hol2ha2eelkvesf6o60%26amp%3Both%3D%25E5%2585%25B6%25E4%25BB%2596&filePostName=Filedata&fileTypes=*.jpg%3B*.gif%3B*.png%3B*.bmp&fileTypesDescription=%E5%95%86%E5%93%81%E5%9C%96%E6%AA%94&fileSizeLimit=1%20MB&fileUploadLimit=5&fileQueueLimit=0&debugEnabled=true&buttonImageURL=%2F%40img%2F%40swfup.png&buttonWidth=113&buttonHeight=26&buttonText=&buttonTextTopPadding=0&buttonTextLeftPadding=0&buttonTextStyle=color%3A%20%23000000%3B%20font-size%3A%2016pt%3B&buttonAction=-110&buttonDisabled=false&buttonCursor=-2" name="flashvars"></object>
------解决方案--------------------
<EMBED src="jqUploader.swf" width=360 height=160 type=application/x-shockwave-flash wmode="transparent" quality="high">
既没有 name 也没有 id 不会也是“复制的时候哦少复制了”了吧