如何在HTML页面及Blogger平台插入自制SWF游戏?
Hey there! Let's break down your two SWF-related questions clearly—this was a go-to tech back in the Flash era, so I know the ins and outs here.
Back in the day, we relied on two main HTML tags to embed SWF files, since browser support varied a bit. Here are both methods with practical code examples:
使用 <object> 标签(更标准,兼容多数浏览器)
<object width="600" height="400" type="application/x-shockwave-flash" data="your-file.swf"> <param name="movie" value="your-file.swf"> <param name="quality" value="high"> <!-- 备用内容,针对不支持Flash的浏览器 --> <p>你的浏览器不支持Flash插件,请更新浏览器或手动启用Flash支持。</p> </object>
使用 <embed> 标签(更简洁,部分旧浏览器偏好)
<embed src="your-file.swf" width="600" height="400" quality="high" type="application/x-shockwave-flash">
⚠️ 关键提醒:现在几乎所有现代浏览器(Chrome、Firefox、Edge等)都默认禁用甚至完全移除了Flash支持。如果你的目标访客需要访问这个内容,他们得手动在浏览器设置里启用Flash(如果还能找到相关选项的话),或者更推荐的方案是把SWF文件转换成HTML5格式,这是更长久、兼容性更好的选择。
Blogger supports custom HTML embedding, so you can follow these steps to add your game:
第一步:上传你的SWF文件
First, upload your SWF game to a storage service that provides a direct access URL (like your own website server, or a hosting platform that allows direct links to SWF files). Make sure the URL points directly to the.swffile, not a web page that contains the file.第二步:编辑Blogger帖子/页面
Open Blogger, create a new post or edit an existing page, then switch to the HTML view (don't use the default "Compose" view—your code will be escaped otherwise).第三步:插入嵌入代码
Paste either the<object>or<embed>code from the first question into the HTML editor. Replaceyour-file.swfwith the direct URL of your uploaded SWF file, and adjust thewidthandheightparameters to match your game's size.第四步:保存并预览
Save your post, then preview it to check the effect. If the game doesn't show up, verify that your SWF URL is correct, and check Blogger's settings: go to "Settings" → "Posts and comments" → "Editor settings" to ensure custom HTML is allowed.
Again, keep in mind the modern browser restrictions on Flash. If possible, convert your SWF game to HTML5 (using tools like Adobe Animate to export HTML5 content, or other conversion tools) to avoid relying on Flash entirely.
内容的提问来源于stack exchange,提问作者TAL




