-4

How check load flash object on Java Script or jQuery no edit flash.

Flash insert to page so (use lib. swfobjec.js):

<script type="text/javascript">
var flashvars = false;
var params = {
    salign: "b",
    wmode: "transparent",
    menu: "false"
};
var attributes = {
  id: "website",
  name: "website",
  styleclass: "myclass"
};

swfobject.embedSWF("gesmMainIndex.swf", "website", "800", "600", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>
3
  • 1
    No idea what you are asking for. Please re-phrase so people can help you. Commented Oct 25, 2012 at 19:25
  • see related question stackoverflow.com/questions/399314/… Commented Oct 25, 2012 at 19:25
  • basically you will need to call JS function from your swf file on load of swf.. Commented Oct 25, 2012 at 19:33

1 Answer 1

1

This is the post that @Amitd was referring to... might help?

"Define a Javascript function that should be invoked if Flash loaded. Invoke this method from the top of your Flash file. Use a timer to detect if the callback is never invoked. Prefer invoking Javascript functions from Flash rather than invoking Flash functions from Javascript. Either way you cannot invoke a function that has not been loaded yet. It is far easier to guarantee that the browser has finished loading your Javascript function before invoking it from Flash, than guaranteeing that Flash finished loading your Flash function before invoking it from Javascript. Here is an example:

I am using swfobject to embed Flash. I use FlashVars to tell Flash which Javascript function to invoke. This is useful if there are multiple Flash objects on the page.

Flash

var params:Object = LoaderInfo(this.root.loaderInfo).parameters;
if (ExternalInterface.available)
{
  var onLoaded:String = params["onLoaded"];
  if (onLoaded != null)
    ExternalInterface.call(onLoaded, true);
}

Javascript

var flashLoaded = false;
var flashTimer;

function onFlashLoaded()
{
flashLoaded = true;
clearTimeout(flashTimer);
}

function onFlashTimeout()
{
if (!isFlashLoaded)
{
    // Remove the Flash object in case it is partially loaded
    $("#videoFeed").empty();
    $("#videoFeed").append('<div id="flashObject"></div>');
    alert("Failed to load video player");
}
clearTimeout(flashTimer);
}

function connectToVideo()
{
var flashvars = {};
flashvars.onLoaded = "onFlashLoaded";

var params = {};
params.menu = false;

var attributes = {};

isFlashLoaded = false;
flashTimer = setTimeout("onFlashTimeout()", 5000);

swfobject.embedSWF("flash/VideoFeed.swf", "flashObject", "800", "600", "11", "expressInstall.swf", flashvars, params, attributes);
}
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.