FLASH 8 : ExternalInterface (flash.external.ExternalInterface)...
Par jeanphilippe, dimanche 18 juin 2006 à 09:32 :: Flash 8 :: #212 :: rss
...ou comment se servir de la classe ExternalInterface (flash.external.ExternalInterface) pour pouvoir controler un objet video contenu dans un SWF depuis la page html.
Tout d'abord, voici l'exemple en ligne, à cette adresse
Le code dans Flash :
import flash.external.*;
var flashFunction:String = "callvideoControl";
var flashFunction2:String = "callvideoControl2";
var instance:Object = null;
ExternalInterface.addCallback(flashFunction, instance, videoControlPause);
function videoControlPause():Void {
vid.pause();
}
ExternalInterface.addCallback(flashFunction2, instance, videoControlPlay);
function videoControlPlay():Void {
vid.play();
}
Dans la page html :
function callExternalInterface() {
getMovieName("ExternalInterface3").callvideoControl();
}
function callExternalInterface2() {
getMovieName("ExternalInterface3").callvideoControl2();
}
function getMovieName(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName]
}
else {
return document[movieName]
}
}input type="button" onClick="callExternalInterface()" value="Video Pause" / input type="button" onClick="callExternalInterface2()" value="Video Play" /
Commentaires
1. Le dimanche 18 juin 2006 à 12:56, par Ifmy
2. Le dimanche 18 juin 2006 à 12:58, par jeanphilippe
3. Le lundi 19 juin 2006 à 16:55, par Ahsx
4. Le lundi 3 juillet 2006 à 16:06, par Ifmy
5. Le lundi 17 juillet 2006 à 11:01, par Ifmy
6. Le lundi 18 décembre 2006 à 01:11, par aana
7. Le dimanche 7 janvier 2007 à 22:02, par antbilly
8. Le lundi 8 janvier 2007 à 10:07, par antbilly
9. Le lundi 8 janvier 2007 à 10:29, par jeanphilippe
10. Le lundi 8 janvier 2007 à 13:55, par antbilly
11. Le lundi 8 janvier 2007 à 16:15, par antbilly
12. Le lundi 8 janvier 2007 à 17:32, par jeanphilippe
13. Le mardi 9 janvier 2007 à 16:25, par Looping
14. Le dimanche 14 janvier 2007 à 15:04, par sinicha
15. Le dimanche 14 janvier 2007 à 16:05, par jeanphilippe
16. Le vendredi 2 février 2007 à 20:34, par shaft75
17. Le dimanche 25 février 2007 à 18:38, par Al
18. Le dimanche 25 février 2007 à 19:10, par jeanphilippe
19. Le dimanche 25 février 2007 à 19:51, par Al
20. Le mercredi 28 mars 2007 à 18:06, par sim
21. Le jeudi 5 juillet 2007 à 05:04, par Julien-Robert
22. Le vendredi 20 juillet 2007 à 23:12, par flashAndFurious
23. Le vendredi 20 juillet 2007 à 23:18, par flashAndFurious
24. Le mercredi 6 février 2008 à 06:51, par Waboo
25. Le jeudi 7 février 2008 à 01:33, par charleda
26. Le jeudi 14 février 2008 à 01:32, par Waboo
27. Le vendredi 19 septembre 2008 à 09:40, par lunnatick
28. Le mardi 2 juin 2009 à 17:47, par alcorsica
Ajouter un commentaire