Javascript and flash movie

This is a discussion on "Javascript and flash movie" within the JavaScript Forum section. This forum, and the thread "Javascript and flash movie are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 10th, 2007, 21:46
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript and flash movie

Hi

I have a HTML form and a swf file what I need to be able to do is when the user clicks submit the flash movie starts to play. but the submit button already starts a CGI Script so the only way I can think of is to add some Javascript to the button. dose anyone know how to do this.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 11th, 2007, 05:41
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

You could try this

Code: Select all
<SCRIPT LANGUAGE="JavaScript"> 
<!--  
var movieName = "testcommand";

function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[movieName]
  } else {
    return document[movieName]
  }
}

function playmovie() {
  thisMovie(movieName).Play();
}
	
//-->
</SCRIPT>
Then add to your button onclick="playmovie()"

That should work..
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 11th, 2007, 07:01
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Sorry to be a pain where in the HTML code should I put this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 11th, 2007, 07:03
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Also what should I change in the code
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 11th, 2007, 10:05
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

You can put that script in the head of your html and just need to change this line

Code: Select all
function playmovie() {
  thisMovie(movieName).Play();
}
to

Code: Select all
function playmovie() {
  thisMovie('movieName').Play();
}
changing moviename to the name of your movie
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 11th, 2007, 18:56
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Hi agian

That did not seem to work. Here is the page http://sographics.co.uk/cb4utrade/Re...r_company.html as you can see the bit with PLEASE WAIT is a movie and what I want is when the user clicks submit the movie will start to show that some thing is happing.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 15th, 2007, 09:14
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Sorry Jason, I missed your reply

Okay, two things

You need to change this

Code: Select all
onclick="playmovie(file uploading.swf)"
to

Code: Select all
onclick="playmovie()"
and change the script to

Code: Select all
<SCRIPT LANGUAGE="JavaScript"> 
<!--  


function thisMovie(swfFile) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
    return window[swfFile]
  } else {
    return document[swfFile]
  }
}

function playmovie() {
  thisMovie('myMovie').Play();
}

window.onload = function () { thisMovie('myMovie').stop();};	
//-->
</SCRIPT>
Now change the actual movie itself to

HTML: Select all
<embed src="file uploading.swf" width="289" height="100" play="false" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" name="myMovie"></embed>
Give that a go, it should do the job.

Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 15th, 2007, 17:18
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Thanks

Sorry I cant seem to see the last bit.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 15th, 2007, 17:25
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

I cant get this to work I have copyed the last bit I think. But it is still not working.

Can you think of any other way of showing a user that the file is being uploaded or that the browers is doing something.

Thanks very much for your time.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Oct 27th, 2007, 14:31
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

So what's happening with the flash movie? Is it not playing or are there some javascript errors coming up?
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Oct 28th, 2007, 08:40
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Hi

It is always playing. I need something to show the users that the file is bening uploaded because it can take about 45mins to upload so I want them to see that it is working.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Oct 28th, 2007, 09:06
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Okay, instead of having the call to stop the movie onload, try putting this after the embedded object in your html.

<script type="text/javascript">
thisMovie('myMovie').stop();
</script>

Because I think it is no loaded fully when the first call happens.

You can also try editing the actual swf so its default state is stopped.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Oct 28th, 2007, 09:44
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Thank you I will try it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Nov 1st, 2007, 20:06
Junior Member
Join Date: Oct 2007
Location: England
Age: 26
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Javascript and flash movie

Hi I am sorry but it will still not work. I dont know what to do. aargh it is really doing my head in. I have tryed all the things you have said.

This is the page, http://www.cb4utrade.co.uk/Register_your_company.html

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Flash movie not loading in IE jogajog Flash & Multimedia Forum 5 Aug 11th, 2008 12:17
Flash Movie enemeth Flash & Multimedia Forum 3 Feb 21st, 2007 17:19
Help! Can't run flash movie alecseiffel Flash & Multimedia Forum 3 Jan 31st, 2007 17:53
Problem with iframe & Javascript - Trying to communicate with a flash movie victorpantet JavaScript Forum 1 Feb 5th, 2006 03:06
Flash Movie Doesn't load in IE jogajog Web Page Design 1 Jan 4th, 2006 00:21


All times are GMT. The time now is 14:17.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42