10-31-2008, 01:23 PM
|
#1
|
|
Registered User
Join Date: Oct 2008
Posts: 4
|
[AS2] enventListener.completed not trigged?
Hello,
I'm playing a FLV-file in my flash-movie, using FLVPlayback (compiled clip). Now I need to execute some code when the movie stops och when the user navigates to another frame using any of a number of buttons. I googled and found a lot of instructions that all looked something like this (my code now):
var enventListener:Object = new Object();
enventListener.completed = function(eventObject:Object):Void{
trace("THIS NEVER HAPPENS!");
}
_root.Kapitel1_film.addEventListener("completed",e ventListener);
where Kapitel1_film is my flv-clip. I tried all different events I could come up with (stopped, statusChange, etc), but nothing ever happens.
I can access the clip, though. E.g. _root.Kapitel1_film.height will give a correct value.
Trace(_root.Kapitel1_film.state) used in the same frame gives 'disconnected', otherwise 'undefined'. All code is in the same frame and same scene as the embedded flv. I'm a newbie here, so I'm probably missing something obvious. Thankful for any hint.
|
|
|
11-01-2008, 08:38 AM
|
#2
|
|
Registered User
Join Date: Oct 2008
Posts: 4
|
enventListener not trigged?
Hello,
sorry for Cross posting, but no reply in the newbie forum.
I'm playing a FLV-file in my flash-movie, using FLVPlayback (compiled clip). Now I need to execute some code when the movie stops och when the user navigates to another frame using any of a number of buttons. I googled and found a lot of instructions that all looked something like this (my code now):
var enventListener:Object = new Object();
enventListener.completed = function(eventObject:Object):Void{
trace("THIS NEVER HAPPENS!");
}
_root.Kapitel1_film.addEventListener("completed",e ventListener);
where Kapitel1_film is my flv-clip. I tried all different events I could come up with (stopped, statusChange, etc), but nothing ever happens.
I can access the clip, though. E.g. _root.Kapitel1_film.height will give a correct value.
Trace(_root.Kapitel1_film.state) used in the same frame gives 'disconnected', otherwise 'undefined'. All code is in the same frame and same scene as the embedded flv. I'm a newbie here, so I'm probably missing something obvious. Thankful for any hint.
|
|
|
11-01-2008, 01:39 PM
|
#3
|
|
Senior Member
Join Date: Mar 2004
Location: Australia
Posts: 318
|
The event name is "complete" not "completed".
|
|
|
11-01-2008, 04:56 PM
|
#4
|
|
Registered User
Join Date: Oct 2008
Posts: 4
|
Right, I typed in wring there. Anyway, that's not the problem, as I wrote I have also tried every other event I can think of, with no result, so something else is wrong....
|
|
|
11-02-2008, 09:08 AM
|
#5
|
|
Senior Member
Join Date: Mar 2004
Location: Australia
Posts: 318
|
Are you adding the event listener to the FLV movie or the FLVPlayback component?
|
|
|
11-03-2008, 09:56 AM
|
#6
|
|
Registered User
Join Date: Oct 2008
Posts: 4
|
To the FLV movie
|
|
|
11-04-2008, 04:32 AM
|
#7
|
|
Senior Member
Join Date: Mar 2004
Location: Australia
Posts: 318
|
Try adding the event listener to the FLVPlayback component instead.
|
|
|
11-04-2008, 03:16 PM
|
#8
|
|
it's all about patience
Join Date: Jun 2005
Location: istanbul
Posts: 6,696
|
It is weird. I have never embedded a flv into my timeline before and I tried it after seeing this thread, but unlike documentation mentions, I got the same result rotsee got, which is: nothing. The 'complete' event handler is never triggered. Weird.
__________________
Ali Inhan
Turkish graphic and web designer
an Apple fan
www.aliinhan.com
|
|
|
11-04-2008, 04:02 PM
|
#9
|
|
Super Moderator
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
|
I think that is a FLVPlayback component bug where the playhead is close enough to the end to end the video, but not close enough to actually call it an end... Or that could happen on some of the FLVs... Not sure what the case is...
The work-around would be basically checking the current playhead location and the length of the video file inside the progress handler to see if they are close enough and you make the complete call when it is...
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 01:27 PM.
///
|
|