Copy link to clipboard
Copied
Bonjour,
J'ai instancié sur la scène d'Animate CC un composant FLVPlayback, nommé projecteur et doté d'une source .f4v, ainsi qu'un texte dynamique nommé message
Le test de l'animation marche parfaitement.
En revanche, l'ajout d'un VideoEvent en as3 donne l'erreur de compilation 1119 : " accès à la propriété STATE_CHANGE peut-être non définie, via la référence de type static Class".
Voici le code, placé sur un autre calque:
import fl.video.VideoEvent;
message.text = projecteur.source;
projecteur.addEventListener(VideoEvent.STATE_CHANGE, infoChgt);
function infoChgt(e:VideoEvent):void {
message.text = "changement d'état";
}
Quelle est la cause de cette erreur, que je ne rencontre pas en Flash pro CS4 ?
Merci par avance de vos lumières.
PL
Thanks Ned for looking over my problem.
A working solution, playing around the problem, is to replace every (including those in declaration of type of a variable) VideoEvent fragment of code that is intended to be used with constants such as COMPLETE, READY, STATE_CHANGE, ... or properties such as playheadTime, with fl.video.VideoEvent .
I guess that the reason why the compiler is otherwise throwing the error 1119 is that it considers the possibility of VideoEvent being the class defined with fla
...Copy link to clipboard
Copied
Be sure to place the component in the library.
Copy link to clipboard
Copied
Yes, the component is sitting in the library, with export to action script checked.
And I have the 1119 error.
Copy link to clipboard
Copied
Thanks Ned for looking over my problem.
A working solution, playing around the problem, is to replace every (including those in declaration of type of a variable) VideoEvent fragment of code that is intended to be used with constants such as COMPLETE, READY, STATE_CHANGE, ... or properties such as playheadTime, with fl.video.VideoEvent .
I guess that the reason why the compiler is otherwise throwing the error 1119 is that it considers the possibility of VideoEvent being the class defined with flash.events, though it's clear in the rest of the line of code (because of the associated constant or property) that it has to deal with the VideoEvent class defined with fl.video .
To my knowledge, VideoEvent is the only class of fl.video that requires to write the extended path, fl.video.VideoEvent.
Adobe could provide a built-in fix to the compiler (it will be appreciated) whenever there is no doubt from the line of code that VideoEvent points the class defined with fl.video .
PL
Copy link to clipboard
Copied
I have had cases like that too. It is odd that there are two built in events with the same name.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now