0

I searched ExternalInterface but didnt got to know, how to implement it.

I want to run/execute a flash when clicked on an image element.

<img src="a.png" onclick="runFlash()" />

my Flash

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="16" HEIGHT="16" id="flashUpload" ALIGN="">
 <PARAM NAME=movie VALUE="{swf_upload_url}?UploadSession={upload_session}&AccessKey={AccessKey}&ServerID={ServerID}&ShowTopBtn=1&TopBtnIcon={SKIN_DIR}/images/a.png">
 <PARAM NAME=quality VALUE=high>
 <PARAM NAME=allowScriptAccess VALUE=always>
 <PARAM NAME=bgcolor VALUE=#000000>
 <PARAM NAME=wmode VALUE=transparent>
 <EMBED src="{swf_upload_url}?UploadSession={upload_session}&AccessKey={AccessKey}&ServerID={ServerID}&ShowTopBtn=1&TopBtnIcon={SKIN_DIR}/images/a.png" quality=high bgcolor=#000000  WIDTH="32" HEIGHT="32" NAME="flashUpload" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT> 

Can you please help me with a detail example?

I tried placing an image above the flash with absolute position but when clicked the flash doesn't run.

Thank You.

Regards,

Shishant Todi

2 Answers 2

2

You could try using SWFObject and put something like this in your runFlash() function:

var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
so.write("flashcontent");

And just put a div on the page named "flashcontent" which initially contains the image.

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

2 Comments

It actually embeds the flash replacing image i want to run the flash when clicked on image.
ok so you can just put the image somewhere else, and the flash will still get loaded into the "flashcontent" div.
0

That's how your AS3 should look like:

ExternalInterface.addCallback("runFlash", jsCallsRunFlash);

function jsCallsRunFlash()
{
    ...
}

//edit

And here's AS2 version tutorial

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.