Paul
Paul

Reputation: 185

Listening for Flash Events using Javascript

I am trying to listen to a an event that is fired by a game when it is fully loaded.

window.addEventListener('gameReady', function(event) {
            console.log(event.data);

});

I know that the gameReady is fired when it is ready to play. IS the above code correct and is there anyway way I can view NON CLICK/INTERFACE events in the Chrome console?

Thanks

Upvotes: 0

Views: 301

Answers (2)

SergeGMZ
SergeGMZ

Reputation: 24

Use ExternalInterface to call javascript functions.

if (ExternalInterface.available)
{
    ExternalInterface.call('console.log', event.data);
}

Just remember that console.log might not be able to process flash objects.

Upvotes: 1

blue112
blue112

Reputation: 56442

You must listen to the event on the flash object.

More info here.

Upvotes: 0

Related Questions