PDA

View Full Version : FlashVars parameter value



threewonders
Apr 19, 2011, 4:44 PM
I need to provide a dynamic value to a parameter.

This works for me




</ext:FlashComponent>
<ext:FlashComponent
ID="FlashComponent1"
runat="server"
Url="http://www.graphicmail.com.es/FusionCharts/Column3D.swf" Flex="1">
<FlashVars>
<ext:Parameter Name="FlashVars" Value="&chartWidth=200&chartHeight=200&debugMode=0&registerWithJS=1&DOMId=Bounced&dataXML=%3cchart+caption%3d''+animation%3d'1'+form atNumberScale%3d'0'+showValues%3d'1'+plotSpacePerc ent%3d'1'+labelDisplay%3d'ROTATE'+palette%3d'2'+sl antLabels%3d'1'++numberSuffix%3d'%25'+maxColWidth% 3d'40'+baseFontSize%3d'10'+baseFontColor%3d'666666 '+baseFont%3d'Tahoma'++showCanvasBg%3d'0'++canvasB aseDepth%3d'1'+%3e++%3cset+label%3d'Email+desc.'+t oolText%3d'Email+desc.%2c+0'+value%3d'0.0'+color%3 d'F7941D'%2f%3e%0d%0a++%3cset+label%3d'Dominio+des c.'+toolText%3d'Dominio+desc.%2c+0'+value%3d'0.0'+ color%3d'7693A7'%2f%3e%0d%0a++%3cset+label%3d'Buzo n+lleno'+toolText%3d'Buzon+lleno%2c+0'+value%3d'0. 0'+color%3d'446E44'%2f%3e%0d%0a++%3cset+label%3d'F iltro+Spam'+toolText%3d'Filtro+Spam%2c+0'+value%3d '0.0'+color%3d'D15D4E'%2f%3e%0d%0a++%3cset+label%3 d'Otros'+toolText%3d'Otros%2c+0'+value%3d'0.0'+col or%3d'9B9B70'%2f%3e%0d%0a+%3c%2fchart%3e%0d%0a" Mode="Value" />
</FlashVars>
</ext:FlashComponent>



But this does not:




<ext:FlashComponent
ID="FlashComponent1"
runat="server"
Url="http://www.graphicmail.com.es/FusionCharts/Column3D.swf" Flex="1">
<FlashVars>
<ext:Parameter Name="FlashVars" Value="#{porfa1}.getValue()" Mode="Value" />
</FlashVars>
</ext:FlashComponent>


<ext:Hidden ID="porfa1" runat="server"></ext:Hidden>



Porfa1 has value in a js function:




var draw = function (cmd, record) {

var value = "&chartWidth=200&chartHeight=200&debugMode=0&registerWithJS=1&DOMId=Bounced&dataXML=%3cchart+caption%3d''+animation%3d'1'+form atNumberScale%3d'0'+showValues%3d'1'+plotSpacePerc ent%3d'1'+labelDisplay%3d'ROTATE'+palette%3d'2'+sl antLabels%3d'1'++numberSuffix%3d'%25'+maxColWidth% 3d'40'+baseFontSize%3d'10'+baseFontColor%3d'666666 '+baseFont%3d'Tahoma'++showCanvasBg%3d'0'++canvasB aseDepth%3d'1'+%3e++%3cset+label%3d'Email+desc.'+t oolText%3d'Email+desc.%2c+0'+value%3d'0.0'+color%3 d'F7941D'%2f%3e%0d%0a++%3cset+label%3d'Dominio+des c.'+toolText%3d'Dominio+desc.%2c+0'+value%3d'0.0'+ color%3d'7693A7'%2f%3e%0d%0a++%3cset+label%3d'Buzo n+lleno'+toolText%3d'Buzon+lleno%2c+0'+value%3d'0. 0'+color%3d'446E44'%2f%3e%0d%0a++%3cset+label%3d'F iltro+Spam'+toolText%3d'Filtro+Spam%2c+0'+value%3d '0.0'+color%3d'D15D4E'%2f%3e%0d%0a++%3cset+label%3 d'Otros'+toolText%3d'Otros%2c+0'+value%3d'0.0'+col or%3d'9B9B70'%2f%3e%0d%0a+%3c%2fchart%3e%0d%0a";

porfa1.setValue(value);

}



Any ideas? Is there another way to give value to a parameter dynamically?
Thank you very much

Vladimir
Apr 19, 2011, 4:57 PM
Hi,

Try to set Mode="Raw" if Value="#{porfa1}.getValue()"

threewonders
Apr 19, 2011, 5:25 PM
<ext:Parameter Name="FlashVars" Value="#{porfa1}.getValue()" Mode="Raw" />


Does not work

Vladimir
Apr 19, 2011, 5:49 PM
Hi,

Please provide full description of result instead "Does not work" otherwise i will not be able to help you

threewonders
Apr 19, 2011, 6:09 PM
The flash component (a bar graph), no data is to draw it.

threewonders
Apr 20, 2011, 10:11 AM
What we achieved in the following way:




protected void draw(object semder, DirectEventArgs e)
{
string envioID = e.ExtraParams["EnvioID"];

var value = "&chartWidth=200&chartHeight=200&debugMode=0&registerWithJS=1&DOMId=Bounced&dataXML=%3cchart+caption%3d''+animation%3d'1'+form atNumberScale%3d'0'+showValues%3d'1'+plotSpacePerc ent%3d'1'+labelDisplay%3d'ROTATE'+palette%3d'2'+sl antLabels%3d'1'++numberSuffix%3d'%25'+maxColWidth% 3d'40'+baseFontSize%3d'10'+baseFontColor%3d'666666 '+baseFont%3d'Tahoma'++showCanvasBg%3d'0'++canvasB aseDepth%3d'1'+%3e++%3cset+label%3d'Email+desc.'+t oolText%3d'Email+desc.%2c+0'+value%3d'0.0'+color%3 d'F7941D'%2f%3e%0d%0a++%3cset+label%3d'Dominio+des c.'+toolText%3d'Dominio+desc.%2c+0'+value%3d'0.0'+ color%3d'7693A7'%2f%3e%0d%0a++%3cset+label%3d'Buzo n+lleno'+toolText%3d'Buzon+lleno%2c+0'+value%3d'0. 0'+color%3d'446E44'%2f%3e%0d%0a++%3cset+label%3d'F iltro+Spam'+toolText%3d'Filtro+Spam%2c+0'+value%3d '0.0'+color%3d'D15D4E'%2f%3e%0d%0a++%3cset+label%3 d'Otros'+toolText%3d'Otros%2c+0'+value%3d'0.0'+col or%3d'9B9B70'%2f%3e%0d%0a+%3c%2fchart%3e%0d%0a";
porfa1.SetValue(value);
}



With javascript does not work (Fn = "draw"), but with an event (OnEvent = "draw"). Why can that be?

Thank you very much