问题
So I'm using visual studio 2019.
I got some code trying to embed a SWF from Doodletoo.com
It loads to 100% and then goes to a black screen. When I right click it says movie not loaded. I've added the Flash variables & the link for the SWF. The button simply starts the SWF. I don't understand though. I managed to get it to load only once. When it did load it caused extreme lag.
Here is my script for the form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace NewtTEst
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnStop_Click(object sender, EventArgs e)
{
axShockwaveFlash1.Stop();
}
private void Button3_Click(object sender, EventArgs e)
{
axShockwaveFlash1.Movie = "http://doodletoo.com/flash/DoodleToo2.swf?v=21";
axShockwaveFlash1.FlashVars = "configUrl=http%3A%2F%2Fdoodletoo%2Ecom%2F%2Fconfig%2Exml&roomID=4&useRefresh=false&isEmbed=false&v=21";
axShockwaveFlash1.Play();
}
}
}
Can someone tell me why it doesn't load the SWF? When I replace the current SWF link with another SWF link. It works fine, playing the SWF.
回答1:
The correct link is:
http://doodletoo.com/flash/DoodleToo2.swf?v=21&configUrl=http://doodletoo.com//config.xml&roomID=4&useRefresh=false&isEmbed=false&v=21
Untested but you can try solving with...
(1) Put flashvars in the same URL of SWF.
private void Button3_Click(object sender, EventArgs e)
{
axShockwaveFlash1.Movie = "http://doodletoo.com/flash/DoodleToo2.swf?v=21&configUrl=http://doodletoo.com//config.xml&roomID=4&useRefresh=false&isEmbed=false&v=21";
axShockwaveFlash1.Play();
}
(2) Change format of your flashvars. Test either Format A or Format B.
private void Button3_Click(object sender, EventArgs e)
{
axShockwaveFlash1.Movie = "http://doodletoo.com/flash/DoodleToo2.swf?v=21";
axShockwaveFlash1.FlashVars = "configUrl=http://doodletoo.com//config.xml&roomID=4&useRefresh=false&isEmbed=false&v=21";
axShockwaveFlash1.Play();
}
Format A:
configUrl=http://doodletoo.com//config.xml&roomID=4&useRefresh=false&isEmbed=false&v=21
Format B:
configUrl=http://doodletoo.com//config.xml;roomID=4;useRefresh=false;isEmbed=false;v=21
来源:https://stackoverflow.com/questions/57423972/movie-not-loaded-for-swf