Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-31-2008, 01:23 PM   #1
rotsee
Registered User
 
Join Date: Oct 2008
Posts: 4
Default [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.
rotsee is offline   Reply With Quote
Old 11-01-2008, 08:38 AM   #2
rotsee
Registered User
 
Join Date: Oct 2008
Posts: 4
Default 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.
rotsee is offline   Reply With Quote
Old 11-01-2008, 01:39 PM   #3
Sly_cardinal
Senior Member
 
Join Date: Mar 2004
Location: Australia
Posts: 318
Default

The event name is "complete" not "completed".
Sly_cardinal is offline   Reply With Quote
Old 11-01-2008, 04:56 PM   #4
rotsee
Registered User
 
Join Date: Oct 2008
Posts: 4
Default

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....
rotsee is offline   Reply With Quote
Old 11-02-2008, 09:08 AM   #5
Sly_cardinal
Senior Member
 
Join Date: Mar 2004
Location: Australia
Posts: 318
Default

Are you adding the event listener to the FLV movie or the FLVPlayback component?
Sly_cardinal is offline   Reply With Quote
Old 11-03-2008, 09:56 AM   #6
rotsee
Registered User
 
Join Date: Oct 2008
Posts: 4
Default

To the FLV movie
rotsee is offline   Reply With Quote
Old 11-04-2008, 04:32 AM   #7
Sly_cardinal
Senior Member
 
Join Date: Mar 2004
Location: Australia
Posts: 318
Default

Try adding the event listener to the FLVPlayback component instead.
Sly_cardinal is offline   Reply With Quote
Old 11-04-2008, 03:16 PM   #8
inhan
it's all about patience
 
inhan's Avatar
 
Join Date: Jun 2005
Location: istanbul
Posts: 6,696
Default

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
inhan is offline   Reply With Quote
Old 11-04-2008, 04:02 PM   #9
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

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...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[AS2] Dialogue With a NPC roadkillguy Gaming and Game Development 1 09-26-2008 04:58 PM
[AS2] Customizing the seekBar in the FLVPlayback component? DiscipleX Components 0 09-25-2008 01:26 PM
[AS2] How to make a list component item respond to double click? lpx Components 0 09-25-2008 11:56 AM
External .swf [as2] and properties problem papiflash ActionScript 2.0 2 05-08-2008 09:09 PM
How to get the name of the component which has been trigged? jfbaro Components 5 07-27-2006 03:39 PM


All times are GMT. The time now is 02:58 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.