As a PHP junior encountering Flex for the first time this scratches my brain for days. The flashvar contains the source of the video I wnat to play in the Flex video component. The HTML of the player looks like:
function createPlayer(videoSource){
document.writeln("<div id=\"player\">");
document.writeln("<object width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
document.writeln("<param name=\"player\" value=\"bin-debug/FlexPlayer.swf\">");
document.writeln("<embed src=\"bin-debug/FlexPlayer.swf\" name=\"player\" width=\"489\" height=\"414\" FlashVars=\""+videoSource+"\">");
document.writeln("</embed>");
document.writeln("</object>");
document.writeln("</div>");
}
I tried to call the FlashVars in the FlexPlayer.mxml but it’s not working. Please tell me what I have to apply in the source in the mxml to access the FlashVars.
<s:VideoPlayer id="Player" left="0" top="0" width="497" height="414"
skinClass="MySkin" source="FlashVars"/>
</s:Group>
What does the variable
videoSourcecontain? If it is an URL to a video and nothing more, it probably won’t work, since flashvars is supposed to be a string that contains variable names and values (not just values).So for example,
flashvars="video.flv"won’t work, butflashvars="sourceUrl=video.flv"can work, if the video player is made to use a variable namedsourceUrl.Also, for the
objectelement you should add a separateparamelement for the flashvars, instead of having flashvars as an attribute of theobjectelement. For theembedelement, flashvars is an attribute, as you have it now (aint standards great 😉More info:
http://kb2.adobe.com/cps/164/tn_16417.html