Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem running Flash movie from onClick event 1

Status
Not open for further replies.

pl12987

Programmer
Aug 2, 2001
53
US
I'm new at integrating Flash movies, so this is probably something basic, but I've tried everything.


1. I am loading this script (where 'logoanim' is the name of the movie, and the label for the embed name and object ID):

<!--
// F. Permadi May 2000
function getFlashMovieObject()
{
if (navigator.appName.indexOf(&quot;Microsoft Internet&quot;)!=-1)
{
return window.logoanim;
}
else
{
return window.document.logoanim;
}
}

function PlayFlashMovie()
{
var flashMovie=getFlashMovieObject();
flashMovie.Play();
}

//-->


2. I am running an imagemap:

<area shape=&quot;rect&quot; coords=&quot;1,1,10,10&quot; href=&quot;#1A&quot; onmouseout=&quot;javascript:change('')&quot;
onmouseover=&quot;javascript:change('testtexthere')&quot;
onClick=&quot;javascript:playFlashMovie()&quot;>

3. The actual movie is further down in a table cell:


<OBJECT classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;
codebase=&quot; ID=Logoanim WIDTH=400 HEIGHT=200>
<PARAM NAME=movie VALUE=&quot;Logoanim.swf&quot;> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED play=false swliveconnect=true name=Logoanim src=&quot;Logoanim.swf&quot; quality=high bgcolor=#FFFFFF WIDTH=400 HEIGHT=200 TYPE=&quot;application/x-shockwave-flash&quot; PLUGINSPAGE=&quot;</OBJECT>


4. The movie runs on load, even though I have play=false above. And when I click on the target, nothing happens. My error says 'undefined is not an object', of if I spec PlayFlashMovie(logoanim) (which I think I shouldn't have to do anyway, I get logoanim is not an object.

So, why doesn't my script recognize the movie, and what do I do to get it to work?
 
You have Logoanim and logoanim being used. Use only Logoanim.

Also the pause at start doesn't seem to be working for me either.
 
Thanks! That did it--I didn't realize id's were case-sensitive. I haven't tried it yet, but I suspect to prevent the run at start we have to spec the movie to frame 0.
 
Ignore post above---

I found it. The PLAY parameter is not an EMBED attribute; it belongs in its own PARAM statement:
<PARAM name=play value=false>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top