benbjohnson / melomel

External ActionScript Interface.
https://github.com/benbjohnson/melomel/wiki
Other
42 stars 8 forks source link

In a pure flash project stage is set to null when Bridge initialises #25

Closed simongregory closed 13 years ago

simongregory commented 13 years ago

In a pure ActionScript/Flash project it should be reasonable to set Melomel.stage with

Melomel.stage = this.stage;
Melomel.connect();

However when the Bridge handles the socket connection it calls Melomel.initialize() which goes on to set Melomel.stage to null if there is no topLevelApplication.

As this is exploratory test for me I've patched it by using:

        stage = (topLevelApplication ? topLevelApplication.stage : stage);

At line 194 of Melomel.as. Not sure how appropriate that is, but it's got me far enough for now.

benbjohnson commented 13 years ago

Thanks for catching that and providing a fix. I patched it and released it as v0.6.5. It's in the Downloads section.