如何在flex中从嵌入式swf发出Loadvars sendAndLoad请求

时间:2015-03-30 20:39:14

标签: flex flash actionscript-2 loadvars

我开发了一个带有嵌入式swf的简单flex应用程序。基本上swf使用Loadvars从特定数据库表中获取数据。好吧,当我在localhost上测试flex应用程序时,它运行正常,并且嵌入式swf使其sendAndLoad调用正确。 但!当它位于Web服务器上时,swf无法正常工作。我的意思是sendAndLoad方法没有返回值。 好吧,提出一些观点:questionContentLoadVars.img1保存(返回)来自php调用的字符串。这个" img1"是仅在Flex应用程序中放置在Web服务器中的空返回字符串,否则它从php调用返回正确的值?

当gameplay22.swf是standallone有效时!

当gameplay22.swf在HTML页面中工作时!

当gameplay22.swf嵌入到FLex中并在LOCALHOST中执行时工作!

但是在网络服务器中,这个嵌入式gameplay22.swf不起作用!

它有什么问题?

//* here is flash(swf) part of gameplay22.swf file which is embedded in the Flex by SWFLOader(gameplay22.swf)

questionContentLoadVars = new LoadVars();
questionContentLoadVars.onLoad = function(success){
    if (success){
        slidingSvityk_mc.descripTA_mc.description_ta.text = questionContentLoadVars.theContent;
    }
    else  
    {
        slidingSvityk_mc.description_ta.text = "err!";      
    }
};

function loadQuestionData(sectionID){
    var tablename ='questionsgeo';  // database tablename
    //sending variables to the PHP script
    questionContentLoadVars.row = sectionID;
    questionContentLoadVars.tablename = tablename;
    questionContentLoadVars.id_ = "";
    questionContentLoadVars.img1 = "";
    questionContentLoadVars.sendAndLoad("getQuestionRec.php",questionContentLoadVars,"_POST");
};

function showLoadedGalleryImages():Void{
    infphp.text = questionContentLoadVars.img1;

    var img1Bulk:MovieClip = new MovieClip();

    img1Bulk = imgGalleryContainer_mc.img1Bulck_mc.createEmptyMovieClip(img1Bulk, _root.getNextHighestDepth());
    img1Bulk._x = 0;
    img1Bulk._y = 0;    
    image_mcl.loadClip(questionContentLoadVars.img1, img1Bulk);
};


//* And here is Flex part of embedded SWFLOader(gameplay22.swf) component 

<s:SWFLoader includeIn="user" width="1024" height="768" horizontalCenter="0" source="gameplay22.swf" verticalCenter="0"/>

0 个答案:

没有答案