3

I have a swf that is a preloader for another swf (a game). I need to callback to the game swf from Javascript but can't figure out how to do this. I can call back into the preloader by registering a callback using the ExternalInterface.

I tried document.getElementById("preloader") which returns an object. The preloader has a public property called GameObj which returns a reference to the game object which has been loaded by the preloader.

The issue is, document.getElementById("preloader").GameObj is always null.

Is it possible to do this or do I need a wrapper call within the preloader?

2
  • you can't access from javascript anything from inside a swf, you can make calls and receive calls and that's it. SO callback into the preloader like you do and let the preloader communicate with the loaded swf. Commented Jun 16, 2015 at 12:11
  • I had a feeling that was going to be the answer. Thanks BotMaster Commented Jun 19, 2015 at 15:15

1 Answer 1

1

Well, you can use ExternalInterface, but is there some reason you can't put your preloader in the same swf?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.