473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

adding event listener (go to url)

I am developing a page in html. I have a div which is playing a flash video. After the flash video stops, I want to take the user to a different url in the same window.
I tried this function but it doesn't work:
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.  
  3. function onVideoStopped(evt:VideoEvent):void
  4. {
  5.     var url:URLRequest = new URLRequest("http://google.com");
  6.     navigateToURL(url, "_self");
  7. }
  8. </script>
Any suggestions???
THANKS!!!!!
Apr 21 '10 #1
5 2822
I will next time, do you have any suggestions on how to fix the code?
Thanks!
Apr 21 '10 #2
Dormilich
8,658 Expert Mod 8TB
I don’t know, what code it is, but it is not JavaScript.

JavaScript is a loosely typed language, so the stuff with the colon (which I suspect as type hinting) should throw errors.

even without that, there are problems
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function onVideoStopped(VideoEvent)
  3. {
  4. // URLRequest is not defined
  5. // any new call "new URLRequest()" will use the local variable and thus fail (in most cases)
  6.     var URLRequest = new URLRequest("http://google.com");
  7. // navigateToUrl() is not defined
  8. // url is not defined
  9.     navigateToURL(url, "_self");
  10. }
  11. </script>
  12.  
event listeners are defined using the addEventListener() method (at least where DOM is concerned).

onVideoStopped is not a HTML event.

but I don’t know, how the flash implementation of JavaScript works, so you better ask in the Flash Forum.
Apr 21 '10 #3
Dormilich
8,658 Expert Mod 8TB
do you have any suggestions on how to fix the code?
not with 'standard' JavaScript (JavaScript used in HTML)
Apr 21 '10 #4
I am a new developer, so I am just beginning to learn javascript. I come from a flash background. I want to write a function in javascript if possible, not in actionscript. I need to add an event listener to a video after it has played. Can I do that in javascript?
Apr 21 '10 #5
Dormilich
8,658 Expert Mod 8TB
the problem will be to tell, when the video finished playing, since playing a video is nothing HTML is concerned about. you would need the video object dispatching an event, to do something with JavaScript.
Apr 21 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Neil Cherry | last post by:
I have to modifiy a program which uses a serial interface and event listeners. The modification entails adding support for connecting to a terminal server via an IP address and port number instead...
6
by: Jeremy | last post by:
I want each instance of an object to be able to listen for input events. When the event occurs, a method of the object should be called, such that "this" is in scope and refers to the object...
6
by: Daz | last post by:
Hi, I am trying to find an event listener which will trigger when the pages starts loading, as opposed to when it's finished, or when the DOM content has finished loading. I am sure that such a...
6
by: Daz | last post by:
Hello everyone, I would like to open a child window from the parent, and add an onload event listener to the child window which will tell the parent when the document has loaded. As far as I...
0
daJunkCollector
by: daJunkCollector | last post by:
I wrote the following script. I have a movieclip named countyA_mc. I want the user to mouse over this movie clip, and result in the sending of a variable to the middle tier. I can establish...
1
Cristian Pinheiro
by: Cristian Pinheiro | last post by:
Hello guys, I was playing with Image Thumbnail Viewer (ITV) and found one problem, see http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm for more details and how it works. Now the...
4
by: xend | last post by:
Hi. I want to add an event handler inside a function that will be used has an object constructor. The event handler to be added is an "method" of the object. if i do this: function...
3
bugboy
by: bugboy | last post by:
i'm trying to avoid inline event handlers by creating a listener. What i'm trying is based on reading this: http://www.quirksmode.org/js/events_advanced.html I can't figure out what i'm doing...
7
Claus Mygind
by: Claus Mygind | last post by:
The event listeners I am adding do not seem to function when the event occurs. Using the inline javaScript method the events work fine (see below). <input type = "text" id = "ID" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.