I'm a complete Flash n00b, but I'm having difficulty and I thought posting my question here was worth a shot, even if it's probably too complex to effectively convey here.
我是一个完整的Flash n00b,但我遇到了困难,我认为在这里发布我的问题值得一试,即使它可能太复杂而无法在这里有效传达。
My client wanted a Flash intro (yuck!) so I made it so that it results in a menu with links to other pages on the site. To minimize annoying visitors, I'm using a cookie to determine if the user was already on the home page, and if so skip the whole animation and just show the menu.
我的客户想要一个Flash介绍(哎呀!)所以我做了它,以便它产生一个菜单,其中包含指向网站上其他页面的链接。为了最大限度地减少烦人的访问者,我使用cookie来确定用户是否已经在主页上,如果是,则跳过整个动画并显示菜单。
I'm using the ActiveContent JavaScript library to embed Flash to my page. I'm passing a value to the Flash file via the query string (e.g., myflash.swf?animation=false
) and in Flash when reading that value using gotoAndPlay()
to jump to the last frame of the animation. I'm using ActionScript 3.
我正在使用ActiveContent JavaScript库将Flash嵌入到我的页面中。我通过查询字符串(例如,myflash.swf?animation = false)将值传递给Flash文件,并在Flash中使用gotoAndPlay()读取该值以跳转到动画的最后一帧。我正在使用ActionScript 3。
In Internet Explorer 8, and only IE, it works as intended. Unfortunately, no other browsers do this; they all show the full animation. The cookie is working correctly, but it's like Flash is totally ignoring the gotoAndPlay
command.
在Internet Explorer 8中,只有IE,它按预期工作。不幸的是,没有其他浏览器这样做;他们都展示了完整的动画。 cookie正常工作,但就像Flash完全忽略gotoAndPlay命令一样。
Since I don't really know what I'm doing, I've probably done this wrong. Like I said, I know this is a longshot without posting gobs of code, but anyone have any ideas?
因为我真的不知道我在做什么,所以我可能做错了。就像我说的,我知道这是一个没有发布大量代码的远景,但任何人都有任何想法?
2 个解决方案
#1
Since it's unlikely you have a flash bug, I'd presume that you're running into differences in how each browser handles the idea of passing variables into embeds. While that's probably fixable for any given browser, a fix that works in every browser may be hairy (especially with older browsers). And of course you never really know you're safe until you test in everything.
因为你不太可能有一个flash bug,所以我认为你在每个浏览器如何处理将变量传递给embeds的想法方面存在差异。虽然这可能适用于任何给定的浏览器,但是在每个浏览器中都可以使用的修复程序可能很麻烦(特别是对于旧版浏览器)。当然,在你测试一切之前,你永远不会真正知道你是安全的。
It would be a lot more robust to look at SharedObject. SOs are essentially cookies, except that the Flash player stores and retrieves them itself, without going through the browser. (They're also not serialized, you can just store a Boolean or whatever.) This sidesteps any differences in how browsers deal with embeds. It also means that if even if a viewer checks the site in IE and then later opens it in Firefox, you can still tell they've already seen the intro.
查看SharedObject会更加健壮。 SO本质上是cookie,除了Flash播放器本身存储和检索它们,而不通过浏览器。 (它们也没有被序列化,你可以只存储一个布尔值或其他。)这避免了浏览器处理嵌入的方式的任何差异。这也意味着即使观众在IE中检查网站然后在Firefox中打开它,你仍然可以告诉他们已经看过这个介绍。
#2
It seems to me the flash is working correctly (since it is working in IE), but somehow the parameter isn't passed to the flash from the other browsers. I suggest adding something in the flash to make sure you are actually getting the parameter you are expecting. Then check in the different browsers to see if it is getting passed.
在我看来,闪存工作正常(因为它在IE中工作),但不知何故该参数不会从其他浏览器传递到闪存。我建议在闪存中添加一些东西,以确保你实际上得到了你期望的参数。然后检查不同的浏览器以查看它是否已通过。
If you could post the ActiveContent call you are using to embed the flash, that would help to see if there is anything wrong with how it is passing the argument to the flash movie.
如果您可以发布用于嵌入闪存的ActiveContent调用,那将有助于查看它是如何将参数传递给flash影片的。
#1
Since it's unlikely you have a flash bug, I'd presume that you're running into differences in how each browser handles the idea of passing variables into embeds. While that's probably fixable for any given browser, a fix that works in every browser may be hairy (especially with older browsers). And of course you never really know you're safe until you test in everything.
因为你不太可能有一个flash bug,所以我认为你在每个浏览器如何处理将变量传递给embeds的想法方面存在差异。虽然这可能适用于任何给定的浏览器,但是在每个浏览器中都可以使用的修复程序可能很麻烦(特别是对于旧版浏览器)。当然,在你测试一切之前,你永远不会真正知道你是安全的。
It would be a lot more robust to look at SharedObject. SOs are essentially cookies, except that the Flash player stores and retrieves them itself, without going through the browser. (They're also not serialized, you can just store a Boolean or whatever.) This sidesteps any differences in how browsers deal with embeds. It also means that if even if a viewer checks the site in IE and then later opens it in Firefox, you can still tell they've already seen the intro.
查看SharedObject会更加健壮。 SO本质上是cookie,除了Flash播放器本身存储和检索它们,而不通过浏览器。 (它们也没有被序列化,你可以只存储一个布尔值或其他。)这避免了浏览器处理嵌入的方式的任何差异。这也意味着即使观众在IE中检查网站然后在Firefox中打开它,你仍然可以告诉他们已经看过这个介绍。
#2
It seems to me the flash is working correctly (since it is working in IE), but somehow the parameter isn't passed to the flash from the other browsers. I suggest adding something in the flash to make sure you are actually getting the parameter you are expecting. Then check in the different browsers to see if it is getting passed.
在我看来,闪存工作正常(因为它在IE中工作),但不知何故该参数不会从其他浏览器传递到闪存。我建议在闪存中添加一些东西,以确保你实际上得到了你期望的参数。然后检查不同的浏览器以查看它是否已通过。
If you could post the ActiveContent call you are using to embed the flash, that would help to see if there is anything wrong with how it is passing the argument to the flash movie.
如果您可以发布用于嵌入闪存的ActiveContent调用,那将有助于查看它是如何将参数传递给flash影片的。