Skip to content Skip to sidebar Skip to footer

Swfobject.js Won't Display Flash In Chrome (works In Edge)

I'm trying to fix this Data Analyzer script which generates flash charts, works fine in the Edge but bugs in chrome somehow by not showing the results. (works in Chrome locally) Ca

Solution 1:

To view your Flash content in Chrome, you have to do following steps:

1) Whilst on your page, click the green padlock icon in address bar.

2) Go to Flash settings and change from Ask (default) into Allow (for all future visits).

3) click Reload in the notification pop-up (or just refresh page).

This is because you're not directly embedding any Flash content (a .swf file) in the page, your DataAnalyzer.js is dynamically adding a div for the SWF later on with code like this:

var div = document.createElement('div');
div.id = "Chart" + count; div.className = 'chartCSS'; dest.appendChild(div);

chartType =  _ge('cmbChartType').value;
if(chartType == 'Random') { chartType = (Math.floor(Math.random()*2)) == 0 ? 'pie' : 'bar'; }

if(chartSrc == 'Flash Chart') 
{
window['myChart'+count] = newSWFObject("open-flash-chart.swf", div.id, this.chartHeight, this.chartWidth, "9", "#FFFFFF");
window['myChart'+count].addVariable("variables","true");
window['myChart'+count].addVariable('x_label_style','10,0x0000FF,2');
window['myChart'+count].addVariable("tool_tip", Charts[count].LabelX + ": #x_label#<br>" + (operation != -1 ? Charts[count].LabelY : 'Count') + ": #val#");
window['myChart'+count].addVariable((chartType == 'pie' ? 'pie' : 'bar_glass'), '50,#7E97A6');
window['myChart'+count].addVariable("title",Charts[count].Title + ',{font-size: 16px;}');

// ...etc etc...

}

This kind of dynamic embedding is also a trick used by malicious sites so it's blocked by default. If you have other end-users, then they too must do those 3 steps in their own Chrome browsers.

Post a Comment for "Swfobject.js Won't Display Flash In Chrome (works In Edge)"