Copy link to clipboard
Copied
I've developed a simple flex app with embedded swf. Basically swf use Loadvars to get data from particular database table. Ok, when I tested the flex app on localhost it is works fine and embedded swf make its sendAndLoad calls correctly.
But! When it is located on the web server swf not work correctly. I meant there is not returned values by sendAndLoad method.
Well, to make some points: questionContentLoadVars.img1 holds(return) the string from php call. This "img1" is an empty returned string only in Flex app placed in the web server otherwise it returns correct value from php call?
When gameplay22.swf is standallone works!
When gameplay22.swf is in HTML page works!
When gameplay22.swf is embedded in FLex and executed in LOCALHOST works!
But in the web server this embedded gameplay22.swf doesn`t works!
What is the problem with it?
//* 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"/>
Copy link to clipboard
Copied
loadvars was an as2 class.
you should use be using the as3 urlloader class.
Copy link to clipboard
Copied
the SWF is coded in AS2 . It is embedded by SWFLoader in Flex. This SWF is a whole game. Its took hard work i'm not gonna recode to AS3.
I will continue to work out!
Thanks for the reply!
Copy link to clipboard
Copied
are you using a cross-domain load?
Copy link to clipboard
Copied
Thanks kglag, for trying to help,
As i posted in another forum the problem was in the free flex example which i used to add another state and by using SWFLoader to embed my swf file.
Now i was created my own flex app and add SWFLoader to embed my swf and voila - it works!
There is no cross-domain loads the loaded content is in the same domain.
So, again thanks!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now