开发者

ActionScript2: How to make 2 flash banners start playing at the same time?

开发者 https://www.devze.com 2023-02-05 01:10 出处:网络
I have 2 flash banners (using ActionScript 2) on my web page, how can I make them start playing at the same time, after the page has fully loaded?

I have 2 flash banners (using ActionScript 2) on my web page, how can I make them start playing at the same time, after the page has fully loaded?

Both .SWF files are embedded in HTML using the script provided by Adobe on object export.

I created both in Flash CS4, but I have very little knowledge of flash, so please explain it thoroughly if you can (and excuse my lack of flash knowledge).

Thanks in advance.

Edit: I read about "LocalConnection", but I have no idea how to implement it in flash开发者_如何学C.


Normally, LocalConnection in ActionScript or a combination of JavaScript and ActionScript, using the ExternalInterface mechanism in ActionScript, would be the recommended way to synchronize two Flash instances.

But since you say you have little knowledge of Flash, I guess you could keep the ActionScript and Flash part to a minimum and make use of the more or less deprecated JavaScript API for the Flash Player described is this (about 10 year old) page:

http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html

In short, what you would do is make it so the swf files would not play automatically, by issuing a stop() command in ActionScript in your Flash files, and later start them from JavaScript using calls like:

swf1.Play();
swf2.Play();

Again, in general, I wouldn't recommend using that old API, designed for Flash content produced about 10 years ago, for Flash Player 5, long before ExternalInterface existed, but under these particular circumstances, it may come in handy.


You can have both flash movies be checking for a variable set to false. When the page finishes loading, set the variable to true with javascript.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号