actionscript - Using ExternalInterface in Flash -


I'm trying to edit some flash to call an external javascript function, but without success here Method 2.0 is the code:

  // Import External .js Import Flash. External ExternalInterface; // ExternalInterface.call ("createPlaylist", "This is my life!");  

And here's my javascript;

  function createplaylay (glitch) {warning ("createPlaylist": "+ dirt"); }  

I have seen so many examples and I am mainly confused about the use of ExternalInterface.addClallback . I do not need JavaScript to return anything to flash, so is it necessary?

For whatever reason, I do not see the alert. Does anyone see any problem in my code? Is there any ExternalInterface library I do not have? In addition, the best way to use ExternalInterface (i.e., error checking, etc.) Thanks in advance ...

ExternalInterface.addClallback is to be able to call Javascript in your Flash application. For example, if you want an HTML button that starts / closes a video, then you add a callback to the named method and can call your JS by calling [FlashObject] .Callback method name.

I would say that there is a way to add ExtraInterface methods to your app to set up a class responsible for JS communication for each interaction case in the best app. For example:

  Public class external videocomroll {Personal video: MediaDisplay; Public Function External Video Control (Video: MediaDisplay) {//ExternalInterface.addClallback - A callback for each category that you want to expose, pointing to a method within this class; // Add listeners to the video player and tell them about the methods of this class, for example in progress) Public Function Play Video (): Zero {Media Play Media on Media} Personal Function Progress on Display (Event: Progressive Event): Zero {/ ExternalInterface.call - Report Back to Javascript Progress}  

To test ExternalInterface more directly, try calling.

  ExternalInterface.call ("Alert", "Hello World!");  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -